C++ programming
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.*****
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..
