Problem Description: In this assignment, you will need to write a program that will allow the user to play a game. The program will start with showing the user a list of two games ('Guess the Number' and 'Math Challenge') and ask the user which one she/he wants to play. However, to keep the assignment manageable, you are being asked to implement only the first of these two games. If the user selects the second game, a 'technical error' message is shown, and the list of games is again shown to select an option from. If the user selects the first game, "Guess the Number", the program will randomly generate a number between 10 and 30 (inclusive) and allow the user at most 10 (ten) chances to guess it. If the user can correctly guess the number within 10 chances, she/he is awarded one point, otherwise zero point is awarded. After a round is over, the user is asked if she/he wants to play a game again or not. If the user enters a Y', she/he is again shown the list of games to choose from. If the user anything else, she/he is shown the total number of points obtained in this session of play (each round contributes at most one point) and the program exits. Implementation: You need to implement the program using 5 (five) functions: (i) (ii) get_validated_input get_game_choice play_math_challenge_game play_guess_the_number_game (iii) (iv) (v) main Each of these functions is dedicated to performing a single task. (i) gets a number from the user within a specified range, (ii) gets a number from the user indicating which game she/he wants to play, (iii) shows a message that this game is not currently playable, (iv) implements the game 'Guess the Number', and (v) is the function that drives the program by presenting the user game options, collecting the option and calling the appropriate game function, asking the choice to continue playing, showing the total points at the end, bidding goodbye, etc. Sample Outputs: Sample output #1 Available games: 1. Guess the number 2. Math challenge Please enter your choice (1/2): 1 =============== Guess the number =========3= I am thinking a number between 10 and 30 You have 10 chances left to guess the number Please enter your guess (10-30): 2 Please enter your guess (10-30): 22 Sorry, you guessed wrong. Try again. You have 9 chances left to guess the number Please enter your guess (10-30): 24 Sorry, you guessed wrong. Try again. You have 8 chances left to guess the number Please enter your guess (10-30): 11 Sorry, you guessed wrong. Try again. You have 7 chances left to quess the number Please enter your guess (10-30): 12 Sorry, you guessed wrong. Try again. You have 6 chances left to guess the number Please enter your guess (10-30): 15 Sorry, you guessed wrong. Try again. You have 5 chances left to guess the number Please enter your guess (10-30): 18 Correct guess! Enter 'Y' if you want to continue. n You are leaving with 1 points ************ 3A8 ***********
Problem Description: In this assignment, you will need to write a program that will allow the user to play a game. The program will start with showing the user a list of two games ('Guess the Number' and 'Math Challenge') and ask the user which one she/he wants to play. However, to keep the assignment manageable, you are being asked to implement only the first of these two games. If the user selects the second game, a 'technical error' message is shown, and the list of games is again shown to select an option from. If the user selects the first game, "Guess the Number", the program will randomly generate a number between 10 and 30 (inclusive) and allow the user at most 10 (ten) chances to guess it. If the user can correctly guess the number within 10 chances, she/he is awarded one point, otherwise zero point is awarded. After a round is over, the user is asked if she/he wants to play a game again or not. If the user enters a Y', she/he is again shown the list of games to choose from. If the user anything else, she/he is shown the total number of points obtained in this session of play (each round contributes at most one point) and the program exits. Implementation: You need to implement the program using 5 (five) functions: (i) (ii) get_validated_input get_game_choice play_math_challenge_game play_guess_the_number_game (iii) (iv) (v) main Each of these functions is dedicated to performing a single task. (i) gets a number from the user within a specified range, (ii) gets a number from the user indicating which game she/he wants to play, (iii) shows a message that this game is not currently playable, (iv) implements the game 'Guess the Number', and (v) is the function that drives the program by presenting the user game options, collecting the option and calling the appropriate game function, asking the choice to continue playing, showing the total points at the end, bidding goodbye, etc. Sample Outputs: Sample output #1 Available games: 1. Guess the number 2. Math challenge Please enter your choice (1/2): 1 =============== Guess the number =========3= I am thinking a number between 10 and 30 You have 10 chances left to guess the number Please enter your guess (10-30): 2 Please enter your guess (10-30): 22 Sorry, you guessed wrong. Try again. You have 9 chances left to guess the number Please enter your guess (10-30): 24 Sorry, you guessed wrong. Try again. You have 8 chances left to guess the number Please enter your guess (10-30): 11 Sorry, you guessed wrong. Try again. You have 7 chances left to quess the number Please enter your guess (10-30): 12 Sorry, you guessed wrong. Try again. You have 6 chances left to guess the number Please enter your guess (10-30): 15 Sorry, you guessed wrong. Try again. You have 5 chances left to guess the number Please enter your guess (10-30): 18 Correct guess! Enter 'Y' if you want to continue. n You are leaving with 1 points ************ 3A8 ***********
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
can you do it in python, thank you.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 6 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY