Question: Declare an enumeration called DaysOfWeek with the following values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday. Declare an enumeration called MonthsOfYear with the following

Declare an enumeration called DaysOfWeek with the following values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday.
Declare an enumeration called MonthsOfYear with the following values: January, February, March, April, May, June, July, August, September, October, November, and December.
Write a program that asks the user to input a number between 1 and 7. The program should then convert the number to a corresponding DaysOfWeek value and print out the name of the day.
Additionally, the program that asks the user to input a number between 1 and 12. The program should then convert the number to a corresponding MonthsOfYear value and print out the name of the month.

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 Programming Questions!