Your task is to develop an application that interactively trains an elementary school student learn Math. The program should ask the student whether h/she wants a question in addition, subtraction or multiplication. Then it should generate the corresponding question with random numbers. It should check the answer given by the student and indicate if it is correct or wrong. If the student doesn’t get the answer in 3 attempts, it should give the answer and ask the next question. The program should repeat this until quit. At the end, the program should print the result statistics.
Use positive integers from 1 to 100 for multiplication, and integers from -1000 to +1000 for addition and subtraction.
A sample screen dialog is given below. You don’t have to use the exact wordings or format as shown below. Feel free to improvise – however, the program should have all the components indicated.
(NOTE: Addition, subtraction and multiplication only).
Welcome to the Math Wizard
What do you want to do? (Enter 1 for addition, 2 for subtraction, 3 for multiplication, 0 to quit): 3
What is 80 times 4?
248
Wrong. Try again.
300
Wrong. Try again.
320
Correct!
Next question? (1 for addition, 2 for subtraction, 3 for multiplication, 0 to quit): 2
What is 40 minus 12?
28
Correct!
Next question? (1 for addition, 2 for subtraction, 3 for multiplication, 0 to quit): 0
OK.
Results:Question Attempts
1
3
2
1
Bye!
怎样编写这个程序用java,我是个初学者,我实在做不出来了。大哥大姐们帮帮小弟吧!
|