- Part (a): Computer-Assisted Instruction - Computer-assisted instruction (CAI) refers to the use of computers in education. Write a program to help an elementary school student learn multiplication. Create a function that randomly generates and returns two positive one-digit integers. Use that function's result in your program to prompt the user with a question, such as How much is 6 times 7 ? For a correct answer, display the message "Very good!" and ask another multiplication question. For an incorrect answer, display the message "No. Please try again.". - Part(b): Reducing Student Fatigue - Varying the computer's responses can help hold the student's attention. Create a function that returns a random response to user answer so various comments are displayed for each answer. Possible responses to a correct answer should include 'Very good!', 'Excellent', 'Nice work!' and 'Keep up the good work!' Possible responses to an incorrect answer should include 'No. Please try again.', 'Wrong. Try once more.', 'Don't give up!' and 'No. Keep trying. ' Choose a random number from 1 to 4 , then use that value to select one of the four appropriate responses to each correct or incorrect answer. - Part(c): Menu - Create a function (menu) that prints type of arithmetic operations and returns user selection. allow the user to pick a type of arithmetic problem to study. 1 means addition problems only, 2 means subtraction problems only, 3 means multiplication problems only, 4 means division problems only, and 5 means a random mixture of all these types. - Part(d): Varying the Types of Problems - Modify part (a) so the function takes one parameter, the user selection (type of operation). Add the other operations listed in the function menu (addition, subtraction, division, and random).
- Part(e): Difficulty Level - Modify part (a) so the function takes another parameter that represents user's difficulty level. At a difficulty level of 1, the program should use only single-digit numbers in the problems and at a difficulty level of 2, numbers as large as two digits. - Part(f): Score - add two counters to the main function to count number of correct and wrong answers. Print both values at the end of the program. - Part(g): Validation - Validate random numbers for subtraction and division operations. For subtraction, swap the integers if the first number is smaller than the second number. For division, if the second number is zero, change it to 1. - Part(h): Menu driven program - Write main function that repeatedly call the function until the user enters \( -1 \). OneDrive
Sample two runs for Computer Assisted Instruction Enter difficulty level (1 or 2): 1 \[ \begin{array}{l} 1=\text { addition } \\ 2=\text { subtraction } \\ 3=\text { multiplication } \\ 4=\text { division } \\ 5=\text { random operation } \\ \text { Enter the operation (1 to } 5 \text { ): } 2 \end{array} \] How much is \( 8-4 \) ? Enter your answer (-1 to exit): 4 Nice work! \[ \begin{array}{l} 1=\text { addition } \\ 2=\text { subtraction } \\ 3=\text { multiplication } \\ 4=\text { division } \\ 5=\text { random operation } \\ \text { Enter the operation ( } 1 \text { to } 5 \text { ): } 3 \end{array} \] How much is \( 3 * 4 \) ? Enter your answers (-1 to exit): 10 Wrong. Try once more. \[ 1 \text { = addition } \]
\( 2= \) subtraction \( 3= \) multiplication \( 4= \) division \( 5= \) random operation Enter the operation \( (1 \) to 5\( ): 3 \) How much is \( 8 * 1 \) ? Enter your answers ( \( -1 \) to exit): 8 Keep up the good work! \( 1= \) addition \( 2= \) subtraction \( 3= \) multiplication \( 4= \) division 5 = random operation Enter the operation (1 to 5\( ): 4 \) How much is 3 // 3 ? Enter your answers ( \( -1 \) to exit): 1 Excellent! \( 1= \) addition \( 2= \) subtraction 3 = multiplication \( 4= \) division 5 = random operation Enter the operation (1 to 5 ): 5 How much is \( 2+5 \) ? Enter your answers ( \( -1 \) to exit): 7 Very good!
\( 1= \) addition \( 2= \) subtraction \( 3= \) multiplication \( 4= \) division \( 5= \) random operation Enter the operation \( (1 \) to 5\( ): 5 \) How much is \( 5 * 6 \) ? Enter your answers ( \( -1 \) to exit): 40 Don't give up! \( 1= \) addition 2 = subtraction \( 3= \) multiplication \( 4= \) division 5 = random operation Enter the operation (1 to 5 ): 5 How much is \( 4-2 \) ? Enter your answers ( \( -1 \) to exit): \( -1 \) Number of correct answers: 4 Number of wrong answers: 2 Thanks for playing!
\( = \) RESTART Enter difficulty level (1 or 2): 2 \( 1= \) addition \( 2= \) subtraction 3 = multiplication \( 4= \) division 5 = random operation Enter the operation (1 to 5): 1 How much is \( 33+75 \) ? Enter your answer (-1 to exit): 108 Nice work! \( 1= \) addition \( 2= \) subtraction 3 = multiplication \( 4= \) division 5 = random operation Enter the operation (1 to 5): 2 How much is \( 21-18 \) ? Enter your answers (-1 to exit): 3 Nice work! \( 1= \) addition \( 2= \) subtraction 3 = multiplication \( 4= \) division 5 = random operation Enter the operation (1 to 5): 4
Enter the operation (1 to 5\( ): 4 \) How much is \( 54 / / 97 \) ? Enter your answers ( \( -1 \) to exit): 1 Don't give up! 1 = addition \( 2= \) subtraction \( 3= \) multiplication \( 4= \) division 5 = random operation Enter the operation (1 to 5 ): 5 How much is \( 55+34 \) ? Enter your answers ( \( -1 \) to exit): 89 Nice work! 1 = addition \( 2= \) subtraction \( 3= \) multiplication \( 4= \) division 5 = random operation Enter the operation (1 to 5 ): 5 How much is \( 16+42 ? \)
Enter your answers (-1 to exit): 42 No. Please try again. 1 = addition 2 = subtraction 3 = multiplication \( 4= \) division 5 = random operation Enter the operation ( 1 to 5\( ): 5 \) How much is \( 37 * 23 \) ? Enter your answers \( (-1 \) to exit): \( -1 \) Number of correct answers: 3 Number of wrong answers: 2 Thanks for playing!