How can I add the following conditions:
1) Make the child ask for a new problem.
2) Display score as percent (numberRight/numberAttempted*100)
3) Ability child to end the program.
ThanksCode:#include <iostream.h> #include <stdio.h> #include <stdlib.h> int main() { int n,i; int x,y; int answer; int wrong=0; cout << "Answer Each of the Following: \n"; n=1; for(i=0;i<n;i++) { x=(rand()%10); // select two random numbers to ask y=(rand()%10); cout << x << " * " << y << " = "; cin >> answer; // get the answer if(answer!=x*y) { cout << "Wrong. Correct answer = " << x*y << endl; wrong=wrong+1; } // if statement } // for loop cout << "Score = " << (n-wrong)*100/n << "%\n"; cout << "Do you want to play again?"; /* char k; cout << "Do you want to play again?"; cin >> k; if(k=="Y") { cout << x << " * " << y << " = "; cin >> answer; // get the answer } else { break; } */ return 0; } // main