Write a Java program that makes a simple menu with a loop using a switch structure. (Not an if statement). The menu will handle five cases and a default. You should have an integer variable called weekday, which the user will input. If choice is a one, it should print out: "Today is Monday." If the choice is two, it should print out "Today is Tuesday." and so on up to five for Friday. If any other value is entered print out "Invalid input" and exit the program.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question

I could really use some help with a problem I got for coding. A screenshot showing an example would help.

Write a Java program that makes a simple menu with a loop using a switch structure. (Not an if
statement). The menu will handle five cases and a default. You should have an integer variable
called weekday, which the user will input. If choice is a one, it should print out: "Today is Monday."
If the choice is two, it should print out "Today is Tuesday." and so on up to five for Friday. If any
other value is entered print out "Invalid input" and exit the program.
Transcribed Image Text:Write a Java program that makes a simple menu with a loop using a switch structure. (Not an if statement). The menu will handle five cases and a default. You should have an integer variable called weekday, which the user will input. If choice is a one, it should print out: "Today is Monday." If the choice is two, it should print out "Today is Tuesday." and so on up to five for Friday. If any other value is entered print out "Invalid input" and exit the program.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Processes of 3D Graphics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning