Hash Fellow robcat2075 Posted August 13, 2023 Hash Fellow Posted August 13, 2023 Lesson 18 While Loops Finally, we can make a program repeat steps! Project idea: John Purcell suggests a program that uses a while loop to do something a number of times. But that's lame, that's what For loops are for. How about... implement the "Price Is Right" guessing game, where the user enters a guess at a secret number, then the computer answers "High" or "Low" or "Correct". Repeat that while the user has not yet guessed the secret number. Lesson 19 Do While Loops Do While is ideal for situation where some condition isn't tested or step isn't done until you are in the loop and that step or test needs to be repeated until it meets some condition. How about a password checker? Just to be clever, make it ask for and check two passwords and require they both be correct. Quote
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.