Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem : Manhattan Cruise Lines sells tickets for dining cruises around Manhattan. It offers three dining options: a la carte, buffet and banquet. It charges

Problem :

Manhattan Cruise Lines sells tickets for dining cruises around Manhattan. It offers three dining options: a la carte, buffet and banquet. It charges different rates for these three options. It also charges differently for lunch versus dinner cruise. The rates are as follows:

Type of Dining Lunch Dinner
a la Carte $ 49.95 $ 65.95
Buffet $ 69.95 $ 89.95
Banquet $ 99.95 $ 125.95

A patron may buy one or more cruise tickets at a time. Weekday tickets are discounted 5% whereas 10% extra is charged for weekend tickets.

Write a program to calculate the cost of buying tickets from Manhattan Cruise Lines.

  1. It must ask the user for the following inputs:
    1. Thetype of dining - a/A for a la carte, f/F for buffet and q/Q for banquet. This should be character input. Handle both lower and upper case input.
    2. The number oftickets.
    3. Whether the tickets are for lunch or dinner. This should be boolean input.
    4. Theday of the week: 1 for Monday through 7 for Sunday.
  2. It must compute:
    1. Thecost of the purchase, calculated as the product of the cost per ticket and the number of tickets;
    2. Thediscount/surcharge based on the day of the week, calculated as the product of the discount/surcharge rate and cost;
    3. Thetotal cost, calculated as the sum of cost and discount/surcharge.
  3. It must print the results in the format shown in theExpected Sample Run section below.

Expected Sample Runs

You must run your program for the followingfour sets of data:

Sample Run Type of dining Number of tickets Time of the cruise Day of the show
A a la Carte 2 Lunch 1 (Monday)
B Buffet 4 Dinner 6 (Saturday)
C Banquet 6 Dinner 5 (Friday)
D Buffet 8 Lunch 7 (Sunday)

Your sample runs must lookexactly as follows (your total amount may be off by 1 cent): Sample Run A:

Please enter the type of meal: a/A for a la carte, f/F for buffet and q/Q for banquet

a

Please enter the number of tickets desired

2

Please enter 1 for dinner and 0 for lunch

0

Please enter the day of the week: 1 for Monday and 7 for Sunday

1

The cost of 2 a la carte tickets for Monday lunch cruise is $ 94.91

Thank you for booking with Manhattan Cruise Lines, your salesperson today was Daniel

Sample Run B:

Please enter the type of meal: a/A for a la carte, f/F for buffet and q/Q for banquet

f

Please enter the number of tickets desired

4

Please enter 1 for dinner and 0 for lunch

1

Please enter the day of the week: 1 for Monday and 7 for Sunday

6

The cost of 4 buffet tickets for Saturday dinner cruise is $ 395.78

Thank you for booking with Manhattan Cruise Lines, your salesperson today was Daniel

Sample Run C:

Please enter the type of meal: a/A for a la carte, f/F for buffet and q/Q for banquet

Q

Please enter the number of tickets desired

6

Please enter 1 for dinner and 0 for lunch

1

Please enter the day of the week: 1 for Monday and 7 for Sunday

5

The cost of 6 banquet tickets for Friday dinner cruise is $ 717.91

Thank you for booking with Manhattan Cruise Lines, your salesperson today was Daniel

Sample Run D:

Please enter the type of meal: a/A for a la carte, f/F for buffet and q/Q for banquet

F

Please enter the number of tickets desired

8

Please enter 1 for dinner and 0 for lunch

0

Please enter the day of the week: 1 for Monday and 7 for Sunday

7

The cost of 8 buffet tickets for Sunday lunch cruise is $ 615.56

Thank you for booking with Manhattan Cruise Lines, your salesperson today was Daniel

Implementation Details

  • Inputs:
    • Accept all character inputs in both lower and upper case.
  • Computations:
    • Use cast operators wherever necessary.
  • Outputs:
    • Print all dollar amounts correct to two decimal places.
    • Make sure the output of your program isexactly as shown in theExpected Sample Run section.
  • Data forms:
    • Declare and use symbolic constants whenever applicable.
    • Use theappropriate data type for each variable.
  • Style:
    • Use proper indentation for your code.
    • Write the algorithm as comments in your program.
    • Factor out code where applicable.

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions