Commit 39fb052
committed
feat: Add user input and real-time delay to simulate dynamic cooling
🧠 Logic:
- User inputs starting temperature and cooling rate.
- `Thread.sleep(1000)` simulates 1-second delay between each cycle.
- Uses `continue` if temperature is above 40°C to skip thermometer output.
- Once temperature <= 0°C, prints "We have ice!" and exits using `break`.
🎯 Focus:
Enhances realism and interactivity of the cooling simulation.
Signed-off-by: Somesh diwan <[email protected]>1 parent 46332c3 commit 39fb052
File tree
1 file changed
+38
-0
lines changed- Section7ConditionalStatements/Loops/src
1 file changed
+38
-0
lines changedLines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments