1) Create a struct for Problem, which holds two ints, first and second. 2) Create two constants, smallest 0, largest 49 3) Create the randomizer using mt19937 and seed the generator using the random device 4) Create a flag continue program and set to true 5) Core of the program should be wrapped with a loop to continue the program while the user chooses to. 6) Prompt the user for the number of questions to answer. 7) Keep track of the number of the total number of attempts 8) Generate each question: a) Initialize a Problem with two random values b) Determine the answer to that problem c) Display the question number, use setfill('0') to add the 0 in front of the number if less than 10. You will need both setfill and setw to help with this. You can assume no more than double digit questions. d) Display the question as in the given output example e) Total number of attempts should be adjusted as guesses are made f) Continue to show the same problem while the answer is incorrect, making sure to count the number of attempts made. 9) Calculate the average (number of questions per total number of attempts) 10) Calculate the percent correct (average times 100) 11) Determine the letter grade on a normal grading scale 12) Determine the positive affirmation to assign a) A: "You are ready for the exam!" b) B: "You're almost there!" c) C: "Keep up the good work." d) Dand F: "Take a small break, don't give up!" 13) Set the decimal precision to 2 14) Display the output as shown in the example
1) Create a struct for Problem, which holds two ints, first and second. 2) Create two constants, smallest 0, largest 49 3) Create the randomizer using mt19937 and seed the generator using the random device 4) Create a flag continue program and set to true 5) Core of the program should be wrapped with a loop to continue the program while the user chooses to. 6) Prompt the user for the number of questions to answer. 7) Keep track of the number of the total number of attempts 8) Generate each question: a) Initialize a Problem with two random values b) Determine the answer to that problem c) Display the question number, use setfill('0') to add the 0 in front of the number if less than 10. You will need both setfill and setw to help with this. You can assume no more than double digit questions. d) Display the question as in the given output example e) Total number of attempts should be adjusted as guesses are made f) Continue to show the same problem while the answer is incorrect, making sure to count the number of attempts made. 9) Calculate the average (number of questions per total number of attempts) 10) Calculate the percent correct (average times 100) 11) Determine the letter grade on a normal grading scale 12) Determine the positive affirmation to assign a) A: "You are ready for the exam!" b) B: "You're almost there!" c) C: "Keep up the good work." d) Dand F: "Take a small break, don't give up!" 13) Set the decimal precision to 2 14) Display the output as shown in the example
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
you will create a

Transcribed Image Text:1. **Create a struct for Problem**, which holds two integers, first and second.
2. **Create two constants**, smallest 0, largest 49.
3. **Create the randomizer** using `mt19937` and seed the generator using the random device.
4. **Create a flag** `continue program` and set to true.
5. **Core of the program** should be wrapped with a loop to continue the program while the user chooses to.
6. **Prompt the user** for the number of questions to answer.
7. **Keep track** of the number of total number of attempts.
8. **Generate each question**:
- a) Initialize a Problem with two random values.
- b) Determine the answer to that problem.
- c) Display the question number, use `setfill('0')` to add the 0 in front of the number if less than 10. You will need both `setfill` and `setw` to help with this. You can assume no more than double-digit questions.
- d) Display the question as in the given output example.
- e) Total number of attempts should be adjusted as guesses are made.
- f) Continue to show the same problem while the answer is incorrect, making sure to count the number of attempts made.
9. **Calculate the average** (number of questions per total number of attempts).
10. **Calculate the percent correct** (average times 100).
11. **Determine the letter grade** on a normal grading scale.
12. **Determine the positive affirmation to assign**:
- a) A: "You are ready for the exam!"
- b) B: "You're almost there!"
- c) C: "Keep up the good work."
- d) D and F: "Take a small break, don’t give up!"
13. **Set the decimal precision to 2**.
14. **Display the output** as shown in the example.

Transcribed Image Text:**Guidelines:**
15) Don't forget to prompt the user to go again.
16) Don't forget the closing message.
---
**Test Run:**
*Your code should look exactly as the one below:*
- Enter number of questions to answer: **5**
**Question 01**
36 + 0 = **36**
**Question 02**
45 + 48 = **50**
45 + 48 = **93**
**Question 03**
14 + 21 = **35**
**Question 04**
48 + 7 = **55**
**Question 05**
21 + 45 = **66**
- Percentage: 83.33%
- Grade: **B**
- Message: You're almost there!
---
*Do you want to play again (y/n)?* **n**
*Thank you for using Simple Exam Prep*
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY