IUP Computer Science
COSC 110     Spring 2006

Project #3
One Night Reservations
(Due 3 March 06)

A new hotel reservation system is being set up to accommodate customers who make exclusively reservations for one night.  The system is being automated to ask the customer a series of questions which can be answered with a single word or a single letter.  From the answers to the questions, the system determines the room price (including tax) and displays this information to the customer.  The system then asks the customer if another reservation is to be made.  It the customer answers in the affirmative, the system asks the questions again and displays the second room price.  When the customer is finished, the system must display the total price of everything, including tax.  The following list indicates the options the system must provide for the customer;

  1. What type of room the customer wants.  Three room types are available:  Suites (which include a kitchenette), a room with one King-size bed, and a room with two Double beds.  The customer must type one word  to indicate the room type.  The cost of a suite is $129 per night; a king is $109; and two doubles is $99.  If the customer enters an invalid word to choose the room type, the system must give him/her a second chance by asking again.  If the customer cannot enter a valid room type in two tries, the system should terminate the interaction with the customer (end the program).
  2. Whether or not an extra bed is required.  The customer may enter a word like "yes" or "no" or a single letter like 'y' or 'n', whichever way you choose to program the question.  An extra bed adds $10 to the cost of any room.
  3. What month and day the reservation is for.  Any night in June and July are regarded as "peak rate" nights.  During these months, a room of any type costs 25% more than the usual rates given above.  If the room has an extra bed, the extra 25% applies to that cost also.  The customer must type a three-letter abbreviation for the month and a number to indicate the date of the reservation.
  4. Whether or not the customer is an AAA, CAA or AARP member.  Membership in one of these organizations entitles the customer to a $5 reduction in the room cost.  The customer may enter a word or a letter to indicate this.  There is no need to separately classify AAA, CAA, and AARP; regard them as equivalent.
  5. Whether or not the customer is an employee of the federal government.  Federal government employees receive a 15% reduction in the cost of their room;  this discount applies to the room cost and the cost of an extra bed (if there  is one).  No customer is allowed to take both a government discount and an AAA/CAA/AARP discount.  The customer may enter a word or a letter to indicate whether or not s/he is a government employee.
After determining the room cost, including add-ons and discounts, a hotel tax is added for each room.  This tax is at a 9.4% rate and is applied to the total room cost after add-ons and discounts.

Suppose the customer makes a request for a room with a King-size bed, no extra bed, for Jun 15 to be occupied by a federal employee.  The system should display something like

Peak Government rate for a King is $115.81 + Tax of $10.89

While a request for a regular customer who is a AAA member and wants a room with a King-size bed and an extra bed for May 10 might see

AAA/CAA/AARP rate for a Double with extra bed is $104.00 + Tax of $9.78

If these two requests are made by the same person and no other requests are made, the program should display the total cost for all reservations, including tax, as

The total cost of all reservations (including tax) is $240.47

Hand in a Visual Studio generated printout of your well documented program and a printout of the output generated for a customer who makes the orders that I will specify two days before the project is due.  Copy your source file (which should be named after yourself) to the appropriate hand-in folder on the P: drive.
 

Note:  The numbers do not quite add up.  115.81 + 10.89 + 104.00 + 9.78 add up to 240.48  not 240.47  What has happened is that in displaying the costs in dollars and cents, one or more of the values has been rounded up for display purposes; but when the actual values are added, one cent is lost.  Don't worry about this loss of one cent; the company isn't worried.