a. Create a quiz game that displays, in turn, five questions about any topic of your choice.

Question:

a. Create a quiz game that displays, in turn, five questions about any topic of your choice. All five questions should have the same three possible multiplechoice answers. For example, you might ask trivia questions about U.S. states for which the correct response is either California, Florida, or New York. After each question is displayed, allow the user to choose one, two, or all three answers by selecting JCheckBoxes. In other words, if the user is sure of an answer, he will select just one box, but if he is uncertain, he might select two or three boxes. When the user is ready to submit the answer(s), he clicks a button. If the user’s answer to the question is correct and he as selected just one box, award 5 points. If the user is correct but has selected two boxes, award 2 points. If the user has selected all three boxes, award 1 point. If the user has selected fewer than three boxes but is incorrect, the user receives 0 points. A total of 25 points is possible. If the user has accumulated more than 21 points at the end of the quiz, display the message Fantastic! If the user has accumulated more than 15 points, display the message Very good, and if the user has accumulated fewer points, display OK. Save the file as HedgeYourBet.java. 

b. Modify the HedgeYourBet game so that it stores the player’s score from the last game in a file and displays the previous score at the start of each new game. (The first time you play the game, the previous score should be 0.) Save the game as HedgeYourBetUsingFile.java.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Programming

ISBN: 978-1337397070

9th edition

Authors: Joyce Farrell

Question Posted: