Write a program that allows a user to enter a string


Problem

Write a program that allows a user to enter a string containing a day of the week (`Sunday', 'Monday', `Tuesday', etc.), and uses a switch construct to convert the day to its corresponding number, where Sunday is considered the first day of the week, and Saturday is considered the last day of the week.

Print out the resulting day number. Also, be sure to handle the case of an illegal day name with an otherwise statement! Display an error message for an illegal day name.

Solution Preview :

Prepared by a verified Expert
Programming Languages: Write a program that allows a user to enter a string
Reference No:- TGS02721979

Now Priced at $30 (50% Discount)

Recommended (97%)

Rated (4.9/5)