|
|
@ -0,0 +1,74 @@ |
|
|
|
## Exercise 1 |
|
|
|
|
|
|
|
enter an integer number: 100 |
|
|
|
|
|
|
|
Mit: |
|
|
|
|
|
|
|
input: 100, Schleifenvariable: 2, Ergebnis 0 |
|
|
|
|
|
|
|
nextInt = 45 |
|
|
|
|
|
|
|
i = 2 , nextInt= 45 |
|
|
|
|
|
|
|
resume |
|
|
|
|
|
|
|
i = 3 |
|
|
|
|
|
|
|
input: 45, Schleifenvariable: 2, Ergebnis 1 |
|
|
|
|
|
|
|
input: 45, Schleifenvariable: 3, Ergebnis 0 |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
nextInt = 47 , i = 2 |
|
|
|
|
|
|
|
input: 47, Schleifenvariable: 2, Ergebnis 1 |
|
|
|
|
|
|
|
input: 47, Schleifenvariable: 3, Ergebnis 2 |
|
|
|
|
|
|
|
input: 47, Schleifenvariable: 4, Ergebnis 3 |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
--- |
|
|
|
## Exercise 2 |
|
|
|
|
|
|
|
Vorher |
|
|
|
|
|
|
|
enter an integer number: 100 |
|
|
|
|
|
|
|
number 100 passed check: false |
|
|
|
|
|
|
|
mit Zahl 45: |
|
|
|
|
|
|
|
nextInt = 23 |
|
|
|
|
|
|
|
count = 3 |
|
|
|
|
|
|
|
- in welcher Zeile steht der Debugger? |
|
|
|
|
|
|
|
Zeile 40 |
|
|
|
|
|
|
|
- Notieren Sie die Anzahl der Einträge in der |
|
|
|
|
|
|
|
private boolean checkNumber(int nextInt) { // nextInt = 16 |
|
|
|
|
|
|
|
nextInt = nextInt - (nextInt / count); // nextInt = 16 , count = 4 |
|
|
|
|
|
|
|
count++; // count = 4 |
|
|
|
|
|
|
|
return checkNumber(nextInt); // nextInt = 16 |
|
|
|
|
|
|
|
- in welcher Zeile steht der Debugger? |
|
|
|
|
|
|
|
Zeile 40 |
|
|
|
|
|
|
|
- Notieren Sie die Anzahl der Einträge in der Debug View |
|
|
|
|
|
|
|
private boolean checkNumber(int nextInt) { // nextInt = 23 |
|
|
|
|
|
|
|
nextInt = nextInt - (nextInt / count); // nextInt = 23, count = 3 |
|
|
|
|
|
|
|
count++; // count = 3 |
|
|
|
|
|
|
|
return checkNumber(nextInt); // nextInt = 23 |