Wednesday, October 10, 2012

Java Exercise #18: Subtraction Quiz Loop

This program is to create a loop of subtraction quiz for primary level.

Exercise: Write a program that uses a loop to create 5 subtraction quizes at a time. It then generates a report and number of correct answers. Sample run below.

What is 8 - 7? 1
You are correct!

What is 7 - 1? 5
Your answer is wrong.
7 - 1 should be 6

What is 2 - 1? 1
You are correct!

What is 7 - 1? 6
You are correct!

What is 9 - 7? 1
Your answer is wrong.
9 - 7 should be 2


Correct count is 3 
Test time is 24 seconds

8 - 7 = 1 correct
7 - 1 = 5 wrong
2 - 1 = 1 correct
7 - 1 = 6 correct
9 - 7 = 1 wrong


Download Code: Subtraction Quiz Loop

No comments:

Post a Comment