Computers are playing an increasing role in education. Write a program that will help an elementary-school student learn multiplication. Use Math.random to produce two positive one-digit integers. It should then display a question such as How much is 6 times 7? The student then types the answer into a text field. Your program checks the student’s answer. If it’s correct, display the string "Very good!" and generate a new question. If the answer is wrong, dis- play the string "No. Please try again." and let the student try the same question again repeatedly until he or she finally gets it right. A separate function should be used to generate each new ques- tion. This function should be called once when the script begins execution and each time the user answers the question correctly.
Computers are playing an increasing role in education. Write a program that will help an elementary-school student learn multiplication. Use Math.random to produce two positive one-digit integers. It should then display a question such as
How much is 6 times 7?The student then types the answer into a text field. Your program checks the student’s answer. If it’s correct, display the string "Very good!" and generate a new question. If the answer is wrong, dis- play the string "No. Please try again." and let the student try the same question again repeatedly until he or she finally gets it right. A separate function should be used to generate each new ques- tion. This function should be called once when the script begins execution and each time the user answers the question correctly.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 4 images