Develop a Java program . The program should act as a trivia game which displays various subtraction questions. The program must initially display a welcome message before it starts showing the questions. It should allow the user to attempt five questions which must be numbered per each attempt (as in the diagram). The questions must be randomly generated from a range of 0 to 9. After each attempt, it must evaluate the question then check the response with the correct answer. A message must be displayed if the answer is correct. Then if the answer is wrong, a message must be displayed and the correct answer must be shown. The program must also record the time taken to answer all five questions then in the end provide a summary of the questions and responses given by the user. the diagram below shows the expected program in operation

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Develop a Java program . The program should act as a trivia game which displays various subtraction questions. The program must initially display a welcome message before it starts showing the questions. It should allow the user to attempt five questions which must be numbered per each attempt (as in the diagram). The questions must be randomly generated from a range of 0 to 9. After each attempt, it must evaluate the question then check the response with the correct answer. A message must be displayed if the answer is correct. Then if the answer is wrong, a message must be displayed and the correct answer must be shown. The program must also record the time taken to answer all five questions then in the end provide a summary of the questions and responses given by the user. the diagram below shows the expected program in operation

Output- ITJVA3Assign1 (run) x
run:
*****Welcome to Siyafunda Maths Trivia Game
***
Trivia Question 1: 9 - 3 = ? 6
That's correct, excellent!
Trivia Question 2: 9 - 8 = ? 1
That's corect, excellent!
Trivia Question 3: 7 - 1 = ? 4
Wrong answer.
7 - 1 should be 6
Trivia Question 4: 4 - 3 = ? 2
wrong answer.
4 - 3 should be 1
Trivia Question 5: 7 - 2 = ? 5
That's correct, excellent!
******* Siyafunda Maths Trivia Game Results Summary***
***
Number of Correct Answers: 3
Time taken: 26 seconds
9-3
6 correct
9-8
1 correct
7-1 =
4 wrong
4-3 = 2 wrong
7-2
5 correct
BUILD SUCCESSFUL (total time: 26 seconds)
Transcribed Image Text:Output- ITJVA3Assign1 (run) x run: *****Welcome to Siyafunda Maths Trivia Game *** Trivia Question 1: 9 - 3 = ? 6 That's correct, excellent! Trivia Question 2: 9 - 8 = ? 1 That's corect, excellent! Trivia Question 3: 7 - 1 = ? 4 Wrong answer. 7 - 1 should be 6 Trivia Question 4: 4 - 3 = ? 2 wrong answer. 4 - 3 should be 1 Trivia Question 5: 7 - 2 = ? 5 That's correct, excellent! ******* Siyafunda Maths Trivia Game Results Summary*** *** Number of Correct Answers: 3 Time taken: 26 seconds 9-3 6 correct 9-8 1 correct 7-1 = 4 wrong 4-3 = 2 wrong 7-2 5 correct BUILD SUCCESSFUL (total time: 26 seconds)
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education