Question: 8. Using the multiple-alternative form of the if statement, write the C++ code for a multiple-alternative selection structure that displays the month. corresponding to the

8. Using the multiple-alternative form of the if statement, write the C++ code for a multiple-alternative selection structure that displays the month. corresponding to the number entered by the user. The number is stored in an int variable named monthNum.

For example, if the monthNum variable contains the number 1, the selection structure should display the string "January". If the month number is not 1 through 12, display the

"Incorrect month number' mossage.

8. Using the multiple-alternative form of the if statement, write the C++

9. The C++ code shown in Figure 6-45 should display "Illinois" when the state code is 1 , "Kentucky" when it's 2, "New Hampshire" when it's 3, "Vermont" when it's 4, and "Massachusetts" when it's 5 . If the state code is not 1 through 5 , the code should display the "Unknown state" message. Correct the errors in the code

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!