Celine Khazarian
1 year ago
3 changed files with 236 additions and 4 deletions
-
4Lerntagebuch.md
-
0Test.md
-
236UebungJava.md
@ -1,2 +1,236 @@ |
|||
### Zeile 36 bis 38 aktiviert |
|||
# Uebung 1 |
|||
|
|||
## Bevor Zeile 36 bis 38 aktiviert wurde: |
|||
|
|||
### Ausgegeben: |
|||
|
|||
(Nummern willkuerlich ausgewaelt) |
|||
|
|||
Enter an integer number: 3 |
|||
number 3 passed check: true |
|||
|
|||
Enter an integer number: 4 |
|||
number 4 passed check: false |
|||
|
|||
Enter an integer number: 5 |
|||
number 5 passed check: true |
|||
|
|||
Enter an integer number: 6 |
|||
number 6 passed check: false |
|||
|
|||
Enter an integer number: 0 |
|||
number 0 passed check: true |
|||
|
|||
Enter an integer number: 11 |
|||
number 11 passed check: true |
|||
|
|||
Enter an integer number: 12 |
|||
number 12 passed check: false |
|||
|
|||
## Zeile 36 bis 38 aktiviert |
|||
|
|||
Ausgegeben: |
|||
|
|||
enter an integer number: 3 |
|||
input: 3, Schleifenvariable: 2, Ergebnis 1 |
|||
number 3 passed check: true |
|||
|
|||
enter an integer number: 4 |
|||
input: 4, Schleifenvariable: 2, Ergebnis 0 |
|||
number 4 passed check: false |
|||
|
|||
enter an integer number: 5 |
|||
input: 5, Schleifenvariable: 2, Ergebnis 1 |
|||
input: 5, Schleifenvariable: 3, Ergebnis 2 |
|||
input: 5, Schleifenvariable: 4, Ergebnis 1 |
|||
number 5 passed check: true |
|||
|
|||
enter an integer number: 6 |
|||
input: 6, Schleifenvariable: 2, Ergebnis 0 |
|||
number 6 passed check: false |
|||
|
|||
enter an integer number: 0 |
|||
number 0 passed check: true |
|||
|
|||
enter an integer number: 11 |
|||
input: 11, Schleifenvariable: 2, Ergebnis 1 |
|||
input: 11, Schleifenvariable: 3, Ergebnis 2 |
|||
input: 11, Schleifenvariable: 4, Ergebnis 3 |
|||
input: 11, Schleifenvariable: 5, Ergebnis 1 |
|||
input: 11, Schleifenvariable: 6, Ergebnis 5 |
|||
input: 11, Schleifenvariable: 7, Ergebnis 4 |
|||
input: 11, Schleifenvariable: 8, Ergebnis 3 |
|||
input: 11, Schleifenvariable: 9, Ergebnis 2 |
|||
input: 11, Schleifenvariable: 10, Ergebnis 1 |
|||
number 11 passed check: true |
|||
|
|||
enter an integer number: 12 |
|||
input: 12, Schleifenvariable: 2, Ergebnis 0 |
|||
number 12 passed check: false |
|||
|
|||
## Breakpoint + Debugg Modus |
|||
|
|||
### Zahl 45 |
|||
|
|||
Zahl 45 eingegeben und ausgegeben wurde die Variable: |
|||
|
|||
nextInt = 45 und |
|||
i = 2 |
|||
|
|||
f5 gedrückt neue Variable: |
|||
|
|||
input: 45, Schleifenvariable: 2, Ergebnis 1 |
|||
|
|||
i = 3 |
|||
|
|||
erneut f5 gedrückt: |
|||
|
|||
input: 45, Schleifenvariable: 3, Ergebnis 0 |
|||
number 45 passed check: false |
|||
|
|||
### Zahl 47 |
|||
|
|||
private boolean checkNumber(int nextInt) { nextInt = 47 |
|||
for (int i = 2; i < nextInt; i++) { i = 2, nextInt = 47 |
|||
int result = nextInt % i; nextInt = 47, i = 2 |
|||
out.println(String.format( |
|||
"input: %d, Schleifenvariable: %d, Ergebnis %d", nextInt, i, |
|||
result)); |
|||
if (0 == result) { |
|||
return false; |
|||
} |
|||
} |
|||
return true; |
|||
} |
|||
Variable: |
|||
|
|||
nextInt = 47 und |
|||
i = 2 |
|||
|
|||
f5 (Resume): |
|||
|
|||
private boolean checkNumber(int nextInt) { nextInt = 47 |
|||
for (int i = 2; i < nextInt; i++) { i = 3, nextInt = 47 |
|||
int result = nextInt % i; nextInt = 47, i = 3 |
|||
out.println(String.format( |
|||
"input: %d, Schleifenvariable: %d, Ergebnis %d", nextInt, i, |
|||
result)); |
|||
if (0 == result) { |
|||
return false; |
|||
} |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
Variable: |
|||
|
|||
nextInt = 47 und |
|||
i = 3 |
|||
|
|||
f5 (Resume): |
|||
|
|||
private boolean checkNumber(int nextInt) { nextInt = 47 |
|||
for (int i = 2; i < nextInt; i++) { i = 4, nextInt = 47 |
|||
int result = nextInt % i; nextInt = 47, i = 4 |
|||
out.println(String.format( |
|||
"input: %d, Schleifenvariable: %d, Ergebnis %d", nextInt, i, |
|||
result)); |
|||
if (0 == result) { |
|||
return false; |
|||
} |
|||
} |
|||
return true; |
|||
} |
|||
Variable: |
|||
|
|||
nextInt = 47 und |
|||
i = 4 |
|||
|
|||
# Uebung 2 |
|||
|
|||
## Ohne Breakpoint |
|||
enter an integer number: 3 |
|||
|
|||
number 3 passed check: true |
|||
|
|||
enter an integer number: 4 |
|||
|
|||
number 4 passed check: false |
|||
|
|||
enter an integer number: 11 |
|||
|
|||
number 11 passed check: false |
|||
|
|||
enter an integer number: 12 |
|||
|
|||
number 12 passed check: false |
|||
|
|||
enter an integer number: 0 |
|||
|
|||
number 0 passed check: true |
|||
|
|||
## Breakpoint Zeile 40 + Zahl 45 eingegeben |
|||
|
|||
private boolean checkNumber(int nextInt) { nextInt = 23 |
|||
if (count > nextInt) |
|||
return true; |
|||
if (nextInt % count == 0) |
|||
return false; |
|||
nextInt = nextInt - (nextInt / count); nextInt = 23, count = 3 |
|||
count++; count = 3 |
|||
return checkNumber(nextInt); nextInt = 23 |
|||
} |
|||
|
|||
Variable: |
|||
|
|||
nextInt = 23 und |
|||
count = 3 |
|||
|
|||
9 Eintraege im Debugg review, darunter 3 Unterpunkte. |
|||
Die Unterpunkte in "Thread [main]" heissen: |
|||
- Uebung2.checkNumber(int) |
|||
- Uebung2.run() |
|||
- Uebung2.main(String[]) |
|||
|
|||
## step over |
|||
|
|||
private boolean checkNumber(int nextInt) { nextInt = 16 |
|||
if (count > nextInt) |
|||
return true; |
|||
if (nextInt % count == 0) |
|||
return false; |
|||
nextInt = nextInt - (nextInt / count); nextInt = 16, count = 4 |
|||
count++; count = 4 |
|||
return checkNumber(nextInt); nextInt = 16 |
|||
} |
|||
|
|||
Variable: |
|||
|
|||
nextInt = 16 und |
|||
count = 4 |
|||
|
|||
von Zeile 40 nichts geandert. Weiterhin auf Zeile 40. |
|||
10 Eintraege im Debugg review, darunter 4 Unterpunkte. |
|||
Die Unterpunkte in Thread [main] heissen: |
|||
- Uebung2.checkNumber(int) |
|||
- Uebung2.checkNumber(int) |
|||
- Uebung2.run() |
|||
- Uebung2.main(String[]) |
|||
|
|||
## step into |
|||
|
|||
von Zeile 40 zu Zeile 34. |
|||
11 Eintraege im Debugg review, darunter 5 Unterpunkte. |
|||
Die Unterpunkte in Thread [main] heissen: |
|||
- Uebung2.checkNumber(int) |
|||
- Uebung2.checkNumber(int) |
|||
- Uebung2.checkNumber(int) |
|||
- Uebung2.run() |
|||
- Uebung2.main(String[]) |
|||
|
|||
# Fragen für die naechste Vorlesung/Übung: |
|||
Welche Eintraege im Debugg review sind erfordert? |
|||
Welcher Inhalt Variable sind erfordert? |
|||
Programm wie bisher starten bedeutet ohne Debuggen? |
|||
bei Uebung2 nach dem ersten Stichpunkt keine Ergebnisse aufschreiben? |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue