Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
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