Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started