Assist needed for assignment

I have an assignment in C++ and I suck at it so much that i got low grades in my mid-term exams and the last chance of passing is through an assignment which I have to hand in this week..Please assist me in my assignment.

The program will ask the user a series of questions, and will keep track of
the number of good / bad answers. For each question, the computer chooses 2
numbers between 0 and 9 and 1 operator (+, -, *, /). The user has to guess the
result of the operation.

example...

Welcome to "Who is the best in math?"
You will be asked a series of question for which you need to
guess the answer as quickly as possible. Ready?
How many questions would you like to have? 8
3 + 5 = 8
Correct!
2 + 5 = 7
Correct!
3 * 0 = 0
Correct!
8 - 2 = 5
Wrong!
1 * 7 = 7
Correct!
0 + 5 = 5
Correct!
6 / 2 = 2
Wrong!
5 + 9 = 11
Wrong!
5 * 3 = 15
Correct!
7 - 8 = -1
Correct!
11 + 6 = 17
Correct!
Thank you for playing!
You had 72 % of correct answers, and 28 % of wrong answers
You answered in 37 seconds
Your longest streak of correct answers is: 3
and your longest streak of wrong answers is: 2

Thank you in advance
closed account (o3hC5Di1)
Hi there,

Let's have a look at how this would look summarized and then tell us which step(s) you would have no clue of how to do in c++:

- Print Welcome message & question to screen
- Read the answer of the question into a variable (n)
- Pose a question n times (this involves generating random numbers and operator)
-- Each time evaluate the input and find a way to keep track of right/wrong answers and streaks
- After n questions, calculate the right/wrong ratio and streaks
- Print the output


Please don't expect us to make our assignment for you, we will help you to complete it, but only in a way so that you learn and understand what you are doing. So you will have a working project when we're done, but you'll have to put in the effort, only then we will too :)

All the best,

NwN
Last edited on
yeah i think the best way to start a program is by creating an outline of what you need(draw pictures of what your program suppose to do if you need to). he basically did it for you. so now start coding and tell us where are you having problems and post your code. it would be much easier for us to help you.
closed account (o3hC5Di1)
Hi,

Another tip to get you started would be to code the project incrementally.
In other words, build up the application one functionality at a time, this will give you a better insight than looking at everything it needs to do at once.

For instance you could code in following steps:

1. Print welcome / ending text
2. Add functionality of requesting a number
3. Add functionality of posing a question (without random numbers) n times
4. Add functionality of questions with random numbers, disregarding the answers
5. Add check of the answers
6. Add keeping track of the answers
7. Add statistics calculations and add those to the output text.

This way you can build it up from the ground up, one building block at a time.

All the best,

NwN
Topic archived. No new replies allowed.