#include <iostream> using std::cout; using std::cin; #include <cstdlib> using st
ID: 3614367 • Letter: #
Question
#include <iostream>
using std::cout;
using std::cin;
#include <cstdlib>
using std::rand;
int main ()
{
int number1;
int number2;
int answer;
int i=0;
do
{
number1 = rand () % 10;
number2 = rand () % 10;
do
{
cout << “How muchis” << number1 << “times” <<number2 << “?”;
cin >> answer;
if (answer!=(number1*number2))
cout << “No, Please tryagain! ”;
else
break;
}
while (true)
cout << “Very good! ”;
i++;
}
while (i<5);
return 0;
Excellent!
Nice work!
Keep up the good work!
Responses to an incorrect answer
NO. Please try again.
Wrong. Try once more.
Don’t give up!
No. Keep trying.
Use the rand function to choose a number from 1 to 4 to selectan appropriate response to each answer. Your program should countthe number of correct and incorrect responses typed by the student.After the student types 10 answers, program should calculate thepercentage of correct responses. If the percentage is lower than 75percent, your program should print ”Please ask yourinstructor for extra help” and terminate.
Explanation / Answer
x.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.