Lecture Outline
- while loops repeat as long as a condition is true. It is very possible to get infinate loops with a while loop
- A do/while loop executes an action, and then repeats if a condition is true (you are guaranteed one loop with a do/while)
- To generate a random number, we must import the Random library. We can then use nextInt(), or nextDouble() to get a random interger or double
Lecture Recording
Lecture Slides
Code