Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the script that will test a person's multiplication skills. The script will prompt the user to enter the difficulty of the problem. Difficulty Levels:

Write the script that will test a person's multiplication skills.

The script will prompt the user to enter the difficulty of the problem.

Difficulty Levels:

Difficulty level 1

All questions are single digit times single digit multiplication questions

9 x 7, 1 x 8, 3 x 4, etc.

Difficulty level 2

All questions are single digit times double digit multiplication questions

6 x 32, 8 x 18, etc.

Difficulty level 3

All questions are double digit times triple digit multiplication questions

12 x 142, 15 x 325, etc.

Breaking down the problem:

Write the main() function that prompts the user to enter a difficulty level.

Make sure the range is between 1 -3 with input validation.

Have the user enter 99 to quit, otherwise keep looping

Write the difficulty_level() function

receives an integer value (1, 2, or 3) that the user entered for the problem difficulty.

Generate two random numbers based on the rules for difficulty level.

Print your name and student number.

Prompt the user to answer the multiplication question by displaying the two numbers as a multiplication question

After receiving the input from the user, the function should check to see if the answer is correct and display the result.

Whether it is correct or incorrect, return to the main menu (no need to make the user try the question again)

Sample output:

[Your Name] (student number) - Multipication Test

Difficulty level (1, 2, 3, or 99 to quit): 2

You chose difficulty level: 2

What is the answer: 3 X 33 = 99

The answer 99 is correct!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions