Question: Write a game that prints three Maya numbers and asks the user to determine which one matches a decimal number. One execution is shown to
Write a game that prints three Maya numbers and asks the user to determine which one matches a decimal number. One execution is shown to the right. Detailed Requirements 1. The user should be prompted to enter an integer that is at least 10; if a number less than 10 is entered the program should terminate 2. The game should generate a correct answer that is a random value between 4 and the number entered by the user 3. Two incorrect answers should be generated randomly; they should be between (correct answer * 0.5) and (correct answer * 1.5); for example, if the correct answer is 4,000 the incorrect answers should be between 2,000 and 6,000 inclusive. 4. The answers should be labeled a, b and c 5. The three answers should be shown in a random order it would too easy for the user if the correct answer was always number a! 6. The user should be repeatedly prompted to answer by entering a, b or c until one of those values is entered 7. A message should be printed indicating if the answer is correct or incorrect; in either case the target decimal value and its correct Maya equivalent should be shown 8. The user should be prompted to play another game, exit if a number less than 10 is entered 9. Like Part 1, it is expected that you solve this problem by writing multiple functions; at the very least you should have a main program loop that calls a separate function to play the game
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
