/************************************************************** * Autor: Peter Lukezic PETER.L@GMX.AT * * Matr.nr.: 0002887 * * Beispiel: 3126 Anzeige * * Kurzbeschreibung: Das Programm liest Datum und Uhrzeit ein * * und ermittelt daraus die Zahlenkolonnen, die angeben, * * welche Segmente einer 7-Segment-Anzeige man aktivieren * * muss, um den Wochentag und die Uhrzeit anzuzeigen. * **************************************************************/ import eprog.*; public class Anzeige { public static void main(String args[]) throws EprogException { //Instantiierung der Klasse datum String ausgabe = new String (datum.wochentag()); //Ausgabe bei jeder Form von falscher Eingabe if (ausgabe.equals("FALSCHE EINGABE")) { EprogIO.println(ausgabe); } else { //für jedes der 6 Zeichen werden Zahlen entsprechend den Positionen //auf der 7-Segment-Anzeige ausgegeben for(int i=0; i<6; i++) { String teilAusgabe=(ausgabe.substring(i,i+1)); if (teilAusgabe.equals("0")) EprogIO.print("123456"); if (teilAusgabe.equals("1")) EprogIO.print("23"); if (teilAusgabe.equals("2")) EprogIO.print("12457"); if (teilAusgabe.equals("3")) EprogIO.print("12347"); if (teilAusgabe.equals("4")) EprogIO.print("2367"); if (teilAusgabe.equals("5")) EprogIO.print("13467"); if (teilAusgabe.equals("6")) EprogIO.print("134567"); if (teilAusgabe.equals("7")) EprogIO.print("1236"); if (teilAusgabe.equals("8")) EprogIO.print("1234567"); if (teilAusgabe.equals("9")) EprogIO.print("123467"); if (teilAusgabe.equals("A")) EprogIO.print("123567"); if (teilAusgabe.equals("D")) EprogIO.print("123456"); if (teilAusgabe.equals("F")) EprogIO.print("1567"); if (teilAusgabe.equals("I")) EprogIO.print("56"); if (teilAusgabe.equals("M")) EprogIO.print("12356"); if (teilAusgabe.equals("O")) EprogIO.print("123456"); if (teilAusgabe.equals("R")) EprogIO.print("123567"); if (teilAusgabe.equals("S")) EprogIO.print("13467"); //Leerzeichen ausgeben if (i!=6) EprogIO.print(" "); } EprogIO.print("\n"); } } }