313
Aufgaben ("geborgt" von Leopold-Franzens-Universität Innsbruck Institut für Informatik)
|
int a = 3; int b = 45; int c = 1; bool d = c == 1; bool e = false == false == 1; Lösung: d= true (1) e= true (1) |
bool x = true; bool y = false; bool z = ((x == y) == y); Lösung: z= true (1) |
|
bool x = false; bool y = true; bool z = false == true == false == x; Lösung: z= false (0) |
bool t = true, f = false, r = true;
|
|
int n=0, m=0; n = ++m; System.out.println(n+" "+m); Lösung: 11 |
int n=0, m=0; n = m++; System.out.println(n+" "+m); Lösung: 01 |
|
Analysieren Sie folgenden Programm-Code: int test(intx){
int y=0;
if (x>3);
else y=1;
return y;
}
Erstellen Sie ein Struktogramm! Lösung... |
Welche Ausgabe hat das Programm bei folgenden Eingaben:
Erstellen Sie ein vereinfachtes Struktogramm und Quellcode für das Programm. Lösung... |
Black Jack (Verzweigung)Gegeben sei folgende Methode: void gewinnen(int a, int b){
if (a>21) System.out.println("b hat gewonnen");
else if (b>21) System.out.println("a hat gewonnen");
else if (a>b) System.out.println("a hat gewonnen");
else if (b>a) System.out.println("b hat gewonnen");
else System.out.println("unentschieden");
}
Analysieren Sie die Funktion der Methode und dokumentieren diese graphisch. |
![]() |
Ein Programm für einen DB-Fahrpreisrechner soll erstellt werden, folgende Regeln gelten:
Analysieren Sie die Verarbeitung und entwickeln Sie gegeignete Test-Daten zur Evaluation ihrer spätern Lösung.
Erstellen Sie eine Methode Fahrpreis.rechne(km,wota: GZ, baca: Bool):FKZ für die Fahrpreisberechnung (Struktogramm und Quellcode). Struktogramm Quellcode
© Oliver Mezger 12.12.2008 MezData.de Den Kontakt herstellen...