#include "g:\victor\vitodef.h" void main(void) { // ***** Ron Sinclair // ***** assignment #3: Multiplication Tester, level 1 randomize(); clrscr(); // ***** declarations int number1, number2, computeranswer, kidanswer, numprobs, count=0; int rightanswers=0, wronganswers=0; char kidsname[20]; cout << "what is your name?\n"; cin >> kidsname; cout << kidsname << ", how many problems would you like to attempt?\n"; cin >> numprobs; while (numprobs != count) { number1=random(13); number2=random(13); cout << kidsname << " , what is " << number1 << " times "; cout << number2 << "?\n"; cin >> kidanswer; computeranswer = number1 * number2; if (kidanswer == computeranswer) { cout << "RIGHT, " << kidsname << " !!" << endl; rightanswers++; } else { cout << "WRONG, " << kidsname << " !!" << endl; wronganswers++; } count++; } cout << kidsname << ", your score is: " << rightanswers << " problems "; cout << "right, and " << wronganswers << " wrong."; getche(); }