Question: / Lab Homework 12 // Using a switch statement to replace an if...else if...else if...else #include #include // for toupper() using namespace std; int main()

/ Lab Homework 12 // Using a switch statement to replace an if...else if...else if...else

#include #include // for toupper() using namespace std;

int main() {

/* Create a program that produces the Sample Output shown at the bottom.

You MUST: - Output all of the lines show below in the Sample Output - spacing, spelling, punctuation, etc. must be exact matches NOTE: There are THREE different runs of the program shown - do not have your program do all three at once - Declare variables and/or constants appropriately, name them according to standards (points will be deducted for poor names), and be sure to use appropriate data types - NOTE: Do NOT use if...else, you MUST use a single switch statement

The messages you must use for each park are as follows: ======================================================================================================= Animal Kingdom: You chose Animal Kingdom. Be sure to ride Kilamanjaro Safari! EPCOT: You chose EPCOT. Be sure to go on Test Track! Great America: You chose Great America. Do you have the guts to try Maxx Force Launch Coaster? Hollywood Studios: You chose Hollywood Studios. Say "Hi" to Han while you fly the Millenium Falcon! Magic Kingdom: You chose Magic Kingdom. The Happily Ever After fireworks are astounding! Universal Studios Orlando: You chose Universal Orlando. Be sure to say "Hi" to Harry Potter! If a valid letter is not selected: You made an invalid selection.

*/ //

return 0; }

/* Sample interaction and output:

Run the program once - the user enters h ========================================== Choose which theme park you want to attend: (A)nimal Kingdom, (E)PCOT, (G)reat America, (H)ollywood Studios, (M)agic Kingdom, or (U)niversal Studios Orlando: h

You chose Hollywood Studios. Say "Hi" to Han while you fly the Millenium Falcon!

Press any key to continue . . .

Run the program a second time - the user enters U ========================================== Choose which theme park you want to attend: (A)nimal Kingdom, (E)PCOT, (G)reat America, (H)ollywood Studios, (M)agic Kingdom, or (U)niversal Studios Orlando: U

You chose Universal Orlando. Be sure to say "Hi" to Harry Potter!

Press any key to continue . . .

Run the program a third time - the user enters 7 ========================================== Choose which theme park you want to attend: (A)nimal Kingdom, (E)PCOT, (G)reat America, (H)ollywood Studios, (M)agic Kingdom, or (U)niversal Studios Orlando: 7

You made an invalid selection.

Press any key to continue . . .

Feel free to run several more tests to check that each option works properly.

*/

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!