Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( only need to do the even version ) Use C + + to write a program to calculate the total fee of booking a

(only need to do the even version) Use C++ to write a program to calculate the total fee of booking a meeting room. The fee calculation must
take into account the duration of the meeting, the number of attendees, and apply differential
pricing for peak hours and holidays. The program should accept the following user inputs in
exact order given below:
Number of persons attending the meeting
Start time of the booking (an hour value in 24-hour format)
End time of the booking (an hour value in 24-hour format)
Whether the booking date is a holiday (a character 'y' or 'n')
Whether the booking is made by a student (a character 'y' or 'n')
The program then calculates and prints the final booking fee according to the charging table
and the charging rules provided below.
Charging Table (in dollars)
In this question, determine you should use either the odd or even version of this question by
referring to the 4th digit of your student ID number. For example, 23547631A uses even
version.
Charging Rules
Input for the number of persons is always positive.
The start time and end time of the booking are always between 0 and 23, and the end time
is always larger than the start time (i.e., the minimum booking duration is one hour).
If the booking date is a holiday, a 50% surcharge on the fee per hour is added.
If the booking is made by a student, a 10% discount on the final fee will be applied.
If the booking time falls between peak hours, for the booking hours during the peak hours,
a 20% surcharge on the fee per hour is added.
Peak hours for ODD version: 0800-1700. Peak hours for EVEN version: 0900-1800.
If the booking duration is equal to or exceeds 4 hours, a 20% discount on the final fee will
be applied.
The final fee is calculated and displayed after all user inputs are received. Its value should be
displayed formatted to two decimal places.
IMPORTANT NOTE: You need to follow all text and order as shown in the sample display.
There should be NO prompt messages and NO additional blank lines in the output. DO NOT
add extra text in the output which will be considered as incorrect in marking.
image text in transcribed

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

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions