Question: Exercise 2: Write a Java program that allows the user to choose the correct answer of a question. (25 Points) See the example below: What

Exercise 2: Write a Java program that allows the user to choose the correct answer of a question. (25 Points)

See the example below: What is the correct way to declare a variable to store an integer value in Java? a. int 1x=10; b. int x=10; c. float x=10.0f; d. string x="10"; Enter your choice: c

Using switch case, your program should tell the user if his/her entered choice was the correct answer or the incorrect answer. Note your program should also display the question and the options (as shown in the example) to the user.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!