this is the assignment:
A while loop. Before you enter the while loop, use a random number generator to generate an integer between 1 and 100. Your while loop terminating condition will be if that number is greater than 30. Inside the loop print the number and add one to it.
Example: If my random number generator gives 25, my program will print 25, 26, 27, 28, 29, 30.
If my random number generator gives 40, my program will exit and nothing will be printed.
A do-while loop. Same logic as in the while loop, but in this case we want to print the number that the random number generator picked, even if it is above 30.
In this case if 40 is chosen at random, 40 should print and the program should terminate.