need help with basic c++ please

I was assigned an assignment that my professor did not teach us how to do at all, so can someone please help me out.
here are the instructions:

Write a program to test an elementary school student in division. Your program should generate a division problem using the random number generator. Your divisor and answer must both be integer values from 1 to 9 which are determined at random. Your program should

• prompt the user for his/her name
• prompt the user for a response to your randomly generated problem
• issue a message either congratulating the user or issuing condolences
along with the correct answer
Out of the things you are asked to do, what can you do? What knowledge do you have? Have you tried to make it at all... it is better to do what you know first and build up on it, also break the program down into small parts to make it easier.
try it yourself first. write it. If it does not work then bring it here. It take half an hour to write thatprogram. Google it. You will find a lot of stuff :)
i honestly have no idea how to do it. if someone could at least push me to the right direction. anything would be a great help
Well first off, your obviously going to have to use a loop. - Decide which one.
Work the program out without the random number generator first - that would seem easier to me first.

You will need a loop for data validation and another for the correct response: heres a code I had for a previous assignment that might help.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* 
Math Game! 
1 * 2 = users input
2 *1...
all the way through 10
*/

#include <iostream>
using namespace std;


int main ()
{
	int secondNumber, inputNumber, result, firstNumber = 1;
	int right = 0, wrong = 0;
	
	for(firstNumber = 1; firstNumber <=10; firstNumber++)
	{
		for(secondNumber = 2; secondNumber <= 10; secondNumber++)
			{
      				do
				{
                     
					cout << firstNumber << " * " << secondNumber << " = ";
						cin >> inputNumber;
						result= firstNumber * secondNumber;
						
						

						if(inputNumber == result)
							{
								cout << "Correct!!\n";
								//right++;
							
							}
						else
							{
								cout << "Try again!\n";
								
							//	wrong++;
								//secoundNumber--;  can use this instead of the do while loop
						
                        	}
				} while(inputNumber != result);
			      
			}
	}
	
	//cout << "Right: " << right << "\nWrong:" << wrong <<endl;
	system("pause");
	return 0;
}


Thats a code for just a simple math game, but the concepts in it can def help you with this program!
Thanks! I appreciate this a lot!
Topic archived. No new replies allowed.