Program Requirements
1. You may not use global variables
2. You may use global constants
3. Generate simple math fact problems:
a. Addition (the total must be an integer >= 0)
b. Subtraction (the difference must be an integer >= 0)
c. Multiplication (the product must be an integer >= 0)
d. Division (the quotient must be an integer >= 0)
4. Validate user input at every opportunity.
5. The program should keep track of the following statistics:
a. The user’s name
b. The total correct answers
c. The total wrong answers
d. The total earnings ($0.05 is awarded for every correct response and $0.03 is subtracted from every incorrect response)
6. A separate text file must be created for every user:
a. Statistics are read from the file at the start of the game (if the user is a returning player).
b. Statistics are recorded at the end of every game.
7. The program must be developed using functions so that the main function consists mostly of function calls.
Below are just a few of the required functions:
a. credits //your name and what the program does
b. menu //display menu with various options
c. validateUserResponse //to validate user input at all stages of the game
d. checkUserAnswer // given a math problem, this function is used to check if the answer the user entered is correct/ incorrect
e. updateStats // used to keep a running total of game statistics
f. displayStats // display statistics on screen
g. retireveStats // retrieve player statistics from external txt file
h. saveStats // save player statistics on external txt file
i. you may also want to consider the following: generateAddition, generateSubtraction,
generateMultiplication and generateDivision // use these to generate a problem of the appropriate type