You are on page 1of 4

GRANBY COLLEGES OF SCIENCE & TECHNOLOGY

College of Information and Communication Technology


Naic, Cavite, Philippines
Tel: (046) 412-0437

Name: Score:
Year and Section: Date:
CASE STUDY
COMPUTER PROGRAMMING 1

General Instructions: Read and analyze the problem below. Provide the algorithm and a C++ program. This is an
individual case study from the preliminary term. Please use any selection statement. Do not use iteration or looping in
the program code.

Deadline: Saturday October 7, 2023 Submit your algorithm, program code and output as PDF file.

COPYING THE PROGRAM CODES TO YOUR CLASSMATES IS CONSIDERED ZERO IN ALL ACTIVITIES FOR THE
PRELIMARY TERM.

Note: I will be choosing 10 students per section to debug the program.

Machine Problem:

The Hyatt Manila hotel wants you to write a C++ program to calculate the base charge for its guests. The program
should prompt the user for the room type. (‘S’ for Single Type, ‘D’ for Double Type, or ‘T’ for Triple Type) and the
number of days the guest is to stay. The program also is to prompt for whether the guest should have a refrigerator in
the room and whether there needs to be an extra bed in the room.

The daily room rates are as follows: A Single type room is $145.00 per day; a Double type room is $185.00 per day. A
Triple type room is $220.00 per day. A refrigerator costs $2.50 extra each day. An extra bed costs $15.00 extra each
day for a triple type room. Calculate the total bill by multiplying the room rate (adjusted for a refrigerator and an extra
bed, if necessary) by the number of days the guest is to stay.

The program should display the room type, the number of days of the stay, the basic daily room rate, the daily charge
for the refrigerator and bed (only if the guest requests these), and the total charge for the stay.

Sample Output:

Please see below …


GRANBY COLLEGES OF SCIENCE & TECHNOLOGY
College of Information and Communication Technology
Naic, Cavite, Philippines
Tel: (046) 412-0437
GRANBY COLLEGES OF SCIENCE & TECHNOLOGY
College of Information and Communication Technology
Naic, Cavite, Philippines
Tel: (046) 412-0437
GRANBY COLLEGES OF SCIENCE & TECHNOLOGY
College of Information and Communication Technology
Naic, Cavite, Philippines
Tel: (046) 412-0437

You might also like