0% found this document useful (0 votes)
39 views4 pages

Comprog Case Study

The document provides instructions for a case study assignment to write a C++ program that calculates hotel room charges. Students are asked to write an algorithm and program that prompts the user for room type (single, double, triple), number of nights, and optional refrigerator/extra bed. The program calculates the total bill based on room rates ($145/night for single, $185/night for double, $220/night for triple) and additional daily fees for the refrigerator ($2.50) and extra bed ($15) if requested. Sample output is also provided. Copying code from classmates is considered cheating.

Uploaded by

Marvin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views4 pages

Comprog Case Study

The document provides instructions for a case study assignment to write a C++ program that calculates hotel room charges. Students are asked to write an algorithm and program that prompts the user for room type (single, double, triple), number of nights, and optional refrigerator/extra bed. The program calculates the total bill based on room rates ($145/night for single, $185/night for double, $220/night for triple) and additional daily fees for the refrigerator ($2.50) and extra bed ($15) if requested. Sample output is also provided. Copying code from classmates is considered cheating.

Uploaded by

Marvin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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