Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Make a class called Favorite_Class that presents the user with a choice of 3 Classes to choose which is there favorite. Use a switch

Java

Make a class called Favorite_Class that presents the user with a choice of 3 Classes to choose which is there favorite. Use a switch block to produce different outputs based on their input. The question is:

What is your favorite class?

A) History class

B) Chemistry class

C) Math class

If the user inputs A, output: "That is very interesting" as well as output a random number (between 1 and 20) of the symbol -. If the user answers B, output: "That's my favorite as well". If the user answers C, output "That's my worst". If the user enters a letter out of range, output "You didn't answer the question." . The user should be able to answer with a capital or lowercase letter.

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

Students also viewed these Databases questions

Question

=+LO 2-3 Discuss the importance of four key workplace attitudes.

Answered: 1 week ago

Question

Can anyone be trained to be a project manager?

Answered: 1 week ago

Question

LO3 Outline strategic compensation decisions.

Answered: 1 week ago