Question: Write a program that transforms numbers 1 , 2 , 3 , . . . , 7 into the corresponding days of the week Monday,

Write a program that transforms numbers 1,2,3,...,7 into the corresponding days
of the week Monday, Tuesday, Wednesday, etc. You should cin the integer from the user and cout the corresponding day (like
in the example below).
You may not use if/else statements to solve this problem. The point of this
question is to get you to practice using string indexing.
Make a very long string Monday Tuesday Wednesday. .. in which you add
spaces so that each day name has the same length.
Then use substr to extract the day of the week you want

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!