5.2(重复加法)程序清单5-4产生了5个随机减法问题。改写该程序,使它产生10个随机加法问题,加数是两个1到15之间的整数。显示正确答案的个数和完全测试的时间。 5.2(Repeat multiplications) Listing 5.4, SubtractionQuizLoop.java, generates five randomsubtraction questions. Revise the program to generate ten random addition questions for two integers between 1 and 15. Display the correct count and test time.
What is 2+12?14
You are correct!
What is 7+13?20
You are correct!
What is 2+11?13
You are correct!
What is 6+4?10
You are correct!
What is 1+9?10
You are correct!
What is 2+11?13
You are correct!
What is 2+15?17
You are correct!
What is 14+14?18
Your answer is wrong.14+14 should be 28
What is 1+8?9
You are correct!
What is 11+7?18
You are correct!
Correct count is 9
Test time is 37 seconds
2+12=14 correct
7+13=20 correct
2+11=13 correct
6+4=10 correct
1+9=10 correct
2+11=13 correct
2+15=17 correct
14+14=18 wrong
1+8=9 correct
11+7=18 correct
Process finished with exit code 0
第五章第二题(重复加法)(Repeat additions)5.2(重复加法)程序清单5-4产生了5个随机减法问题。改写该程序,使它产生10个随机加法问题,加数是两个1到15之间的整数。显示正确答案的个数和完全测试的时间。5.2(Repeat multiplications) Listing 5.4, SubtractionQuizLoop.java, generates five randomsubtraction questions. Revise the program to generate