Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume youve been assigned the task to create tickets for Disney World based on which theme park the customer wants to visit and the number

Assume youve been assigned the task to create tickets for Disney World based on which theme park the customer wants to visit and the number of days. Create a program that prompts the user to enter two values a character and a number and then displays a randomly generated ticket based on those two values. The character represents the theme park and the number represents the number of days. For this assignment, the following characters will be used to denote the theme park:

A: Animal Kingdom E: Epcot H: Hollywood Studios M: Magic Kingdom Number of days: must be between 1 and 7 Once theme park and number of days are BOTH obtained, generate a random ticket for the selected theme park using these given patterns

Write code that: Prompts user for theme park and number of days This information will be entered on the same line with a space between the two values (E 5) Reads theme park as a string (e.g. user enters E for Epcot) o See details below in Must Do and Tips Reads number of days as an integer (e.g. user enters 5 for a 5 day ticket) Extracts from the string the theme park character (A, E, H, or M) and ensures it is valid If theme park is valid, ensure number of days is valid (1 through 7

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions