Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use ONLY if, else if, and else (conditionals) as well as do-while loops in JAVA. 8.2: Trivia tester In this problem, you will write a

Use ONLY if, else if, and else (conditionals) as well as do-while loops in JAVA.

8.2: Trivia tester

In this problem, you will write a program that asks the user a trivia question and tells them whether or not they got it right. First, print the question and answer choices, then prompt for a guess. Then, display a message in response to the user's guess telling them if it was correct. The examples and test cases will tell you what question to ask.

Be sure to match the expected format and pass all the test cases. Don't forget to use good style in your solution and add implementation comments where appropriate.

Example input/output 1:

Trivia time! In what year did TSU officially change its name to Tennessee State University? 1. 1955 2. 1962 3. 1968 4. 1991 Enter a guess (1-4): 3 Correct!

Example input/output 2:

Trivia time! In what year did TSU officially change its name to Tennessee State University? 1. 1955 2. 1962 3. 1968 4. 1991 Enter a guess (1-4): 1 Incorrect. The correct answer was 3 (1968).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions

Question

8. Providing support during instruction.

Answered: 1 week ago