HOMEWORK #2
Date: 03/11/2006 Due date: 16/11/2006
Computers are playing
an increasing role in education. Write a program that will help an elementary
school student learn multiplication. Use rand to produce
two positive one-digit integers. It should then type a question such as:
How
much is 6 times 7 ?
The student then types
the answer. Your program checks the student’s answer. If it is correct, print “Very good!” and then ask another multiplication question. If the
answer is wrong, print “No. Please try
again.” And then let the student
try the same question again repeatedly until the student finally gets it right.
NOTES:
1)
Please make sure that
each time your program is run, your algorithm should generate different random
numbers.
2)
Use sentinel value to
exit from reading integer numbers.
3)
Use a function to do multiplication.
Recommendations &
Cautions:
1) Write the
purpose of the program at the beginning of your code using the comment sign.
2) Provide the
necessary explanations for the variables you use.
3) Explain
which program you used for the source code generation (MS Visual C++, .NET or
GNU C Compiler) for the proper evaluation of your homework. Give this
information in your e-mail.
4) Homeworks submitted
after the due date will not be accepted.
5) Submit your homework
through the web page.
Good Luck!