C PROGRAMMING. Write a program that will help an elementary school student learn multiplication. Use the rand function to produce two postive one-digit integers. It should then type a question such as: How much is 6 times 7? (Of course each time the numbers will be different) The student then types the answer. If the answer is correct then display "Very Good", if wrong then display "No, please try again". Let the student try the same question again repeatedly until it finally gets it right.
To use random function include:
#include
srand(time(NULL)); //use only once after variables declarations to generate a seed number for random function
rand() % 10 //random function to produce a random number from 0 to 9, use it anywhere but after srand() was called
Hint:
int a,b,c;
srand(time(NULL));
a = rand() % 10;
Write a function or functions and modify the program that that you did on homework 7. By using the rand function you will generate in this case the following responses to a correct answer:
Very Good!
Excellent!
Nice Work!
Keep up the good work!
for an incorrect answer these will be the answers:
No, please try again.
Wrong, try once more.
Don't give up.
No, keep trying.