We are going to practice using the jGRASP debugger with Hailstone.java.
This program computes a sequence of integers called a hailstone sequence.
(This is related to an unsolved problem in mathematics known as the
Collatz Conjecture.)
continued on the next slide...
valueprintHailstoneMaxMin(7, 10);
value as the loop executes.
| # |
value
|
|---|---|
| first value |
7
|
| second value |
22
|
| third value |
11 |
| fourth value |
34 |
| fifth value |
17 |
| sixth value |
52 |
continued on the next slide...
minprintHailstoneMaxMin(7, 20);
min during the second call.
| # |
min
|
|---|---|
| first value |
7
|
| second value |
5 |
| third value |
4 |
| fourth value |
2 |
| fifth value |
1 |