Need help designing a program with python. Here's what I'm trying to make. A menu-driven modular program in Python so the user can take a 3-question math quiz at a specified difficulty level. Easy(1), Intermediate(2), and Hard(3). After the quiz, display the quiz level, and number of correct questions the user answered. There should be three functions named main, display_menu and generate_random. Function display_menu displays the menu of difficulty levels, prompts the user for input and validates the user's response. Only 1, 2 or 3 are valid input. The function receives no arguments and returns the user's response as an integer. Function generate_random receives the user's response (1, 2, or 3) as an argument and uses this integer to generate a single digit positive integer, a two digit positive integer or a three digit positive integer respectively. Function main calls function display_menu, then loops three (3) times. Within the loop, function generate_random is called twice (so as to generate two random integers), passing the difficulty level integer to the function generate_random. Next, the user is prompted to calculate the addition of the two random integers and the response is collected. The user's response is compared to the correct answer and if the user answered correctly, the correct answer count is incremented. After the three iterations of the loop, the difficulty level and number of correct answers are displayed

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...
icon
Related questions
Question

Need help designing a program with python.

Here's what I'm trying to make.

  • A menu-driven modular program in Python so the user can take a 3-question math quiz at a specified difficulty level. Easy(1), Intermediate(2), and Hard(3). After the quiz, display the quiz level, and number of correct questions the user answered.
  • There should be three functions named maindisplay_menu and generate_random.

  • Function display_menu displays the menu of difficulty levels, prompts the user for input and validates the user's response. Only 1, 2 or 3 are valid input. The function receives no arguments and returns the user's response as an integer.

  • Function generate_random receives the user's response (1, 2, or 3) as an argument and uses this integer to generate a single digit positive integer, a two digit positive integer or a three digit positive integer respectively.

  • Function main calls function display_menu, then loops three (3) times. Within the loop, function generate_random is called twice (so as to generate two random integers), passing the difficulty level integer to the function generate_random. Next, the user is prompted to calculate the addition of the two random integers and the response is collected. The user's response is compared to the correct answer and if the user answered correctly, the correct answer count is incremented. After the three iterations of the loop, the difficulty level and number of correct answers are displayed

I'm quite inexperienced with python and would appreciate the guidance and assistance!

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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 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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY