Write a program that reads an integer indicating the day of the week from the user and on the next line prints whether that day is a weekday or a weekend day. Consider Sunday the Day 0 of the week and Saturday the Day 6 of the week. Please use a switch statement with minimum number of break statements for your program.

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter8: Working With Advanced Functions
Section: Chapter Questions
Problem 2.8CP
icon
Related questions
Question
100%

Write a program that reads an integer indicating the day of the week from the user and on the next line prints whether that day is a weekday or a weekend day. Consider Sunday the Day 0 of the week and Saturday the Day 6 of the week. Please use a switch statement with minimum number of break statements for your program. In java code

Please enter a number between 0 and 6 indicating the day of the week:
Weekend
Please enter a number between 0 and 6 indicating the day of the week
1
Weekday
Please enter a number between 0 and 6 indicating the day of the week:
2
Weekday
Please enter a number between 0 and 6 indicating the day of the week:
3
Weekday
Transcribed Image Text:Please enter a number between 0 and 6 indicating the day of the week: Weekend Please enter a number between 0 and 6 indicating the day of the week 1 Weekday Please enter a number between 0 and 6 indicating the day of the week: 2 Weekday Please enter a number between 0 and 6 indicating the day of the week: 3 Weekday
Please enter a number between 0 and 6 indicating the day of the week:
4
Weekday
Please enter a number between 0 and 6 indicating the day of the week:
5
Weekday
Please enter a number between 0 and 6 indicating the day of the week:
6
Weekend
Please enter a number between 0 and 6 indicating the day of the week:
7
Invalid input!
Please enter a number between 0 and 6 indicating the day of the week:
1021
Invalid input!
Transcribed Image Text:Please enter a number between 0 and 6 indicating the day of the week: 4 Weekday Please enter a number between 0 and 6 indicating the day of the week: 5 Weekday Please enter a number between 0 and 6 indicating the day of the week: 6 Weekend Please enter a number between 0 and 6 indicating the day of the week: 7 Invalid input! Please enter a number between 0 and 6 indicating the day of the week: 1021 Invalid input!
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,