For this lab, start with a prototype of the Math Tutor project from our text; chapter 5 problem 8 on page 298 (294 in 8th edition).
*****Do not Turn in project till after we have reviewed Functions.*****
Once you have this code base, it will need to be refactored in the following way:
1. When code executes Program Title should display.
2. Program should prompt for user (Student) name. (You should use getline(cin,name) for this instead of just cin.)
3. Program will Display a menu for problem type:
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Quit
- Program will prompt for menu choice
- Program should prompt for number of problems to present
- Program will randomly generate problem of type chosen and display
- Prompt user for answer
- Check answer
- If correct display “Correct”
- If incorrect, display “incorrect” and show correct value
- Repeat step 6 for number of times user entered in step 5
- Calculate grade and display on screen for student to see
- Show percentage based on correct answers divided by number of problems
- Save value to “report.txt”
- Program should return to name prompt.
I will be going over functions during week 6. I would like you to refactor code into functions after the lesson. This will be part 2 of the project
*****Do not Turn in project till after we have reviewed Functions.*****
I will also go over how to append data to an existing file, instead of overwriting. To append a file use ios::app when you open your file. Like this
ofstream outputFile;
outputFile.open(“demofile.txt”,ios::app);
cout << “Now writing data to the file.n”;
For random number, review pages 128 to 131 in chapter 3. Make sure you are seeding your function.
*****Do not Turn in project till after we have reviewed Functions.*****
Looking for a solution written from scratch with No plagiarism and No AI?
WHY CHOOSE US?
We deliver quality original papers |
Our experts write quality original papers using academic databases.We dont use AI in our work. We refund your money if AI is detected |
Free revisions |
We offer our clients multiple free revisions just to ensure you get what you want. |
Discounted prices |
All our prices are discounted which makes it affordable to you. Use code FIRST15 to get your discount |
100% originality |
We deliver papers that are written from scratch to deliver 100% originality. Our papers are free from plagiarism and NO similarity.We have ZERO TOLERANCE TO USE OF AI |
On-time delivery |
We will deliver your paper on time even on short notice or short deadline, overnight essay or even an urgent essay |