Assignment 3 Wiki - AustinSoup/CS101L GitHub Wiki

The Great and Powerful Flarsheim

You’ll need to use many types of loops for this assignment. Some may be nested in others, for instance you may have an outer loop in a game that keeps playing, and an inner loop performing another iterative task. You’ll want to think and experiment with the best ways to implement. In this lab, the great prognosticator “Flarsheim”, will let the user choose a number in their head from 1 to 100. It will then ask the remainder of this number when divided by 3, 5 and 7. Your program must validate proper input on each. The remainder when divided by 3 can only be 0, 1 or 2. The remainders for 5 and 7 are different. To find what number the user is thinking of just find the number from 1 to 100 that has the same remainder for 3, 5, and 7 and astound them with the result. They are then asked if they want to play again. The player may enter Y or N only.

You can work on this bottom up or top down. Bottom up means working on individual low level details first. For instance, possibly write the code to get input for the remainder of 3. Remember it has to validate that, so the loop should continue to run while the user gives bad input.

Top down means you work on the overall flow first without any details filled in. Possibly create the outer loop to continue playing, then with successive iterations keep applying more detail. Image1 Image 2 At the beginning of the code, I started with some print statements. Then I started to write the loop for the program. In the the loop it would start to ask the user for there input, and then I added print statements for the program to output if the user entered number within the criteria or did not. Then when the three numbers came out of the list, the output for the program was coded. Along with asking if the user wanted to play again or not.

Image 1 The screenshot shows how the program runs. First it welcomes the player and then asks the user to think of a number between 1 and 100. For the first remainder 3 question it shows that the input must be more than zero but less than 3. Then it shows the input for remainder question5 and 7. Then after the user does all there inputs it outputs the number you were thinking of and tell you how amazing it is. Then at the end it will ask you to play again or if you want to quit the program.