Hi all, I'm new to programming and been using this website to get information for a while now...I must say this is a really good website...
now I have a question about a program I need to write:
here is the questionsorry if it's too long lol)
Computer-Assisted Instruction) The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use the rand function to produce two positive one-digit integers. The program should then prompt the user with a question, such as
How much is 6 times 7?
The student then inputs the answer. Next, the program checks the studentís answer. If itís correct, display the message ďVery good!Ē and ask another multiplication question. *If the answer is wrong, display the message ďNo. Please try again.Ē and let the student try the same question repeatedly until the student finally gets t right. A separate function should be used to generate each new question. This function should be called once when the application begins execution and each time the user answers the question correctly.
(Computer-Assisted Instruction: Reducing Student Fatigue) One problem in CAI environments is student fatigue. This can be reduced by varying the computerís responses to hold the studentís attention. Modify the program of above problem so that various comments are displayed for each answer as follows:
Possible responses to a correct answer:
Keep up the good work!
Possible responses to an incorrect answer:
No. Please try again.
Wrong. Try once more.
Donít give up!
No. Keep trying.
Use random-number generation to choose a number from 1 to 4 that will be used to select one of the four appropriate responses to each correct or incorrect answer. Use a switch statement to issue responses
now my program is like this:
printf("Hello, this is computer assited instruction for multiplication...\nHow much is the product of %d and %d? \n",a,b);
printf("no please try again");
don't laugh, I know it's not close to the answer at all!!!
I needed to know how I can use the rand() to take only 1-10?!
and then about the second part, how to use rand() to make that sentences!!! I've already read the rand() on c++ in this website but it wasn't much help in writing it in C, though it really helped in getting the concept of the function rand()
anyone have any idea please let me know, would really appreciate it