Question: JAVA Question 1 Write a program that given a number from 1 to 7 outputs what day of the week it corresponds to (1-Monday, 7

JAVA
 JAVA Question 1 Write a program that given a number from
1 to 7 outputs what day of the week it corresponds to

Question 1 Write a program that given a number from 1 to 7 outputs what day of the week it corresponds to (1-Monday, 7 = Sunday) and whether it is a weekday or weekend. You may assume an integer as input but if the input is not from 1 to 7, you should output that it's not a valid day. Write two versions of this program: Version 1: Use an if/else statement Version 2: Use a Switch statement (instead of an if/else) Here are a few sample outputs to illustrate the expected behavior of your program. Note: user input is highlighted in grey Please enter the day of the week as a number (1-7): 7 It's Sunday! It's the weekend! Please enter the day of the week as a number (1-7): 5 It's Friday! It's a weekday

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!