Question: C++ Project summary The program shall test a users math skills with randomly generated arithmetic problems. The program shall be written for a 5th grade

C++ Project summary

The program shall test a users math skills with randomly generated arithmetic problems. The program shall be written for a 5th grade audience.

Project Instructions

Write a program that creates random arithmetic problems for solution.

Main Menu

There shall be one main menu, as follows:

ARITHMETIC PRACTICE PROGRAM

Welcome to the Math Skills Practice Program.

This program allows you to practice your math skills.

Choose what to practice in the menu shown below.

---------------------------------------------------------

ARITHMETIC PRACTICE PROGRAM MAIN MENU

---------------------------------------------------------

a. Addition

b. Subtraction

c. Multiplication

d. Division

q. Quit the program

---------------------------------------------------------

Enter your choice [ a b c d q ]:

Difficulty Level and the Role of the Random Number Generator

The "difficulty level" chosen by the user shall determine the number of digits used for each operand in a problem. The program shall offer difficulty levels 1 through 5 to the user at program startup. The random number generator (RNG) shall be used to generate the operands for each problem. For example, if a user chooses level 3 and the current problem is a multiplication one, then a problem like the following should be generated.

Solve:

123

X456

____

(a) 56088

(b) 57045

(c) 21321

(d) 14198

(e) NONE OF THE ABOVE

The numbers "123" and "456" are the operands for the problem, and the RNG is responsible for selecting them. In the case of divison, the two random numbers shall be the divisor and the quotient. The RNG shall also generate the five choices for the problem, and decide which of them is the correct one. If the correct choice is not NONE OF THE ABOVE, exactly one of the remaining four choices must be the correct answer. If the correct choice is NONE OF THE ABOVE, the RNG must select four wrong answers for a through d.

OUTPUT FILE

The name of the output file shall be: firstname_lastname_results.txt, using the users actual first and last name. The output file shall consist of: ITEM 0 Users name ITEM 1 Timestamp for program start ITEM 2 The number used to seed the random number generator ITEM 3 The difficulty level chosen by the user The following items relate to a single problem and will be repeated, as a group, for each problem given to the user: ITEM 4 Timestamp for the problem ITEM 5 Problem shown to the user (includes all choices presented to the user) ITEM 6 Correct choice for the problem ITEM 7 Number of attempts by user ITEM 8 The choice given by the user ITEM 9 Users current "correct" percentage At the termination of the program: ITEM 10 Timestamp for program end

PROGRAM DESIGN

Here is a rough program design. You will need to flesh it out.

STEP 1. Startup details ---- Get user name ---- Get difficulty level ---- Seed RNG ---- Open output file

STEP 2. Display main menu

STEP 3. Get users main menu choice ---- Quit if necessary

STEP 4. Generate and present problem to user ---- Interact with user

STEP 5. Allow three chances to get the correct answer ---- Interact with user

STEP 6. Record results to output file

STEP 7. Return to STEP 2 It should be apparent that STEPs 2 through 7 form a loop. Upon quitting, the program shall write its final information to the output file, then close it.

PROGRAM REQUIREMENTS

The program shall be menu-driven, and the user shall be prompted for information that is needed and not obtained from the menu. The program shall present arithmetic problems for solution that are appropriate for a 5th grade audience. The user shall be given three attempts to solve each problem. Each problem shall have five (5) choices: a through e. In each case, choice e shall be NONE OF THE ABOVE. The "difficulty level" chosen by the user represents the number of digits used for the problems. The random number generator (RNG) shall be used for all problems. An output file shall be produced with the data described above. The program shall be written using procedural programming methods and modular design. (No "gotos" or OOP.) All detailed code shall reside in functions other than main(). No global variables are to be used: Data values must be passed into and out of functions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!