Question
Write a guess game that asks the user to enter an integer number and displays three different hexadecimal numbers then asks the user to guess
Write a guess game that asks the user to enter an integer number and displays three different hexadecimal numbers then asks the user to guess which hexadecimal number matches their entered number. Your program should include the following: 1- Ask the user to enter a number between 10 and 50. 2- Find the equivalent Hexadecimal number to user entered number. 3- Generate randomly two more numbers one is smaller than the number entered by the user and one is bigger. These two numbers also are converted to Hexadecimal numbers. 4- Display the three hexadecimal numbers. 5- Prompt the user to guess the correct hexadecimal number. 6- Display a congrats message if the user guesses the answer and sorry message if they did not. 7- Prompt the user if they want to play another game. Notes: 1- It is possible the user to enter 10 or 50. In this case the program should generate the two random numbers either both above in case of 10 or both below in case of 50. 2- You should not display the answers in the same orders. Sample run Please enter number between 10 and 50: 2 Sorry, your entered number is out of the range. Please enter number between 10 and 50: 23 Which of the following hexadecimal numbers is equivalent to 23 a- 17 b- 1D c- F Enter your answer: b Sorry, this is not the correct answer. The correct answer is 17 Would you like to play again Y/y for yes and N/n for no? Y Please enter number between 10 and 50: 44 Which of the following hexadecimal numbers is equivalent to 44 a- 30 b- 12 c- 2C Enter your answer: d Try again, select a, b or c. Which of the following hexadecimal numbers is equivalent to 44 a- 30 b- 12 c- 2C Enter your answer: d Well done! The correct answer is 2C Would you like to play again Y/y for yes and N/n for no? n
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started