Question
solution for 5.52 #include #include #include void generateQuestion(int *num1, int *num2) { *num1 = rand() % 9 + 1; *num2 = rand() % 9 +
solution for 5.52
#include
void generateQuestion(int *num1, int *num2) { *num1 = rand() % 9 + 1; *num2 = rand() % 9 + 1; } int main() { srand(time(0)); int num1, num2, result, userRes; int resIndex; double percentage;
char rightComments[4][50] = {"Very good!", "EXcellent!", "Nice work!", "Keep up the good work!"}; char wrongComments[4][50] = {"NO. Please try again.", "Wrong. Try once more.", "Don't give up !","No.Keep trying."};
char ch; char repeat;
int correctResponses = 0; int incorrectResponses = 0; int flag = 0; do {
generateQuestion(&num1, &num2); result = num1 * num2; printf("How much is %d times %d? ", num1, num2); scanf("%d", &userRes);
while(userRes != result) { resIndex = rand()%4; printf("%s ", wrongComments[resIndex]); incorrectResponses++;
if (incorrectResponses + correctResponses == 10){ flag = 1; break; }
printf("How much is %d times %d?", num1, num2); scanf("%d", &userRes); }
if (flag){ percentage = (double)correctResponses/10; if (percentage
resIndex = rand()%4; printf("%s ", rightComments[resIndex]); correctResponses++;
if(correctResponses + incorrectResponses == 10){ percentage = (double)correctResponses/10; if (percentage
printf("Do you like to try another question? Enter 'y' or 'Y': "); scanf("%s", &ch);
} while(ch == 'y' || ch == 'Y'); return 0; }
in c programming plz
for 5.53 and 5.54 seperately
thank you
5.52 (Computer-Assisted Instruction: Monitoring Student Performance) More sophisticated computer-assisted instruction systems monitor the student's performance over a period of time. The decision to begin a new topic is often based on the student's success with previous topics. Modify the program of Exercise 5.51 to count the number of correct and incorrect responses typed by the student. After the student types 10 answers, your program should calculate the percentage that are correct. If the percentage is lower than 75%, display "Please ask your teacher for extra help.", then reset the program so another student can try it. If the percentage is 75% or higher, display " Congratulations, you are ready to go to the next level!", then reset the program so another student can try it. 5.53 (Computer-Assisted Instruction: Difficulty Levels) Exercises 5.50, through Exercise 5.52 developed a computer-assisted instruction program to help teach an elementary-school student multiplication. Modify the program to allow the user to enter a difficulty level. At a difficulty level of 1, the program should use only single-digit numbers in the problems; at a difficulty level of 2, numbers as large as two digits, and so on. 5.54 (Computer-Assisted Instruction: Varying the Types of Problems) Modify the program of Exercise 5.53 to allow the user to pick a type of arithmetic problem to study. An option of 1 means addition problems only, 2 means subtraction problems only, 3 means multiplication problems only and 4 means a random mixture of all these typesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started