Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that will help an elementary school student learn math. The program should ask the user to pick a type of arithmetic

Write a C++ program that will help an elementary school student learn

math. The program should ask the user to pick a type of arithmetic problem to

study. Option 1 means addition problems, 2 means subtraction problems, 3

means multiplication problems, and 4 means division problems. If user picks 5,

program should randomly pick one of the options 1-4 and entering 6 should end

the program. The program should also allow the user to enter a difficulty level. At

a difficulty level 1, the program should use only single-digit numbers in the

problems, at a difficulty level 2, numbers as large as two digits, and so on.

The program should prompt the user with a question, such as

How much is 6 times 7?

The student then inputs the answer. If the answer is correct, program displays one

of the following messages:

Very good!

Excellent!

Nice work!

Keep up the good work!

(Use rand () function to choose a number from 1 to 4 that will be used to select

one of the four messages to each correct answer)

If the answer is wrong, program displays one of the following messages:

No, please try again.

Wrong, try once more.

Dont give up!

No, keep trying.

(Use rand () function to choose a number from 1 to 4 that will be used to select

one of the four messages to each incorrect answer)

Let the student try the same question repeatedly until the student gets it right.

Your program should have at least four functions: one to display the menu, one to

generate questions, one function randomly chooses response to correct answer,

and one function randomly chooses response to incorrect answer.

Do not use global variables. Be sure the user only selects 1- 6 when selecting an

item from the menu.

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions