Earn Higher Grades With Instant Assignment Help.Ask Question!

Computer Science
(5/5)

This is our first project requiring you to use everything we have done so far in the class. Create a new class called BobcatHotel (BobcatHotel.java) to do all your work.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Overview

This is our first project requiring you to use everything we have done so far in the class. Create a new class called BobcatHotel (BobcatHotel.java) to do all your work. You may work in pairs or by yourself. The expectation is that you work on the project outside of lab time, but you may certainly use any extra time during the lab sessions. Your partner can be in any section. Both you and your partner will make separate submissions (and demonstrations), each noting the collaborator/partner in the “Comments…” text-box in the submission page. We have included sample runs to give you a better idea of how the program works given the project requirements. Refer to your previous lab assignments for hints on how to approach this project. You can ask the TAs or the instructor for clarifications and help. This project is worth 100 points so be sure to complete it. Submit BobcatHotel.java for this project in the assignment page after properly formatting it as stated in the instructions below.

 

Problem

You have been hired by a consultant firm to work on a hotel reservation program (BobcatHotel.java). This program will provide an estimated cost to users reserving a room in a hotel. Bobcat hotel has the following types of rooms that are available:

  1. Single: $50.50 per night

  2. Double: $75.00 per night

  3. Queen: $100.75 per night

  4. King: $150.25 per night

  5. Master Suite: $225.50 per night

The hotel also offers the following meal packages (prices shown are per guest per night):

  1. Complementary: Free

  2. Standard: $30.00 Deluxe: $50.00

  3. Indulgence: $85 (only available to guests who reserve the Master Suite) Your program will perform the following operations:

  4. Display an intro message to the users displaying the various room options that are

  5. Ask the user the following information:

    1. Number of

    2. Their choice of

    3. How many nights they would like to

    4. Whether they are a AAA member. AAA discount is calculated based on

    5. Whether they are a club member. Club member discount is calculated based on

    6. What type of meal package they would like to purchase. Note: not all choices will be available for all room types (see program logic below for details).

  6. Depending on the user’s choices, compute the base room cost, meal cost, preliminary total cost, applicable discounts, and final total cost of booking as explained

  7. Display checkout messages with all costs and

 

Program Logic

The logic of the program to calculate various costs and discounts is as follows:

  • Calculate the base room cost for the reservation by multiplying the number of nights and the price per night for the selected room. For e.g., staying in the Master Suite room for 5 nights will result in a base room cost of 5*150.25 = $1127.5.

 

  • Calculate the meal cost by multiplying the number of guests, number of nights, and the meal package price. For e.g., with 2 guests staying for 5 nights in the Master Suite who select the Indulgence package, the meal cost will be 2 * 5 * 85 = $850. Note that only user who select the Master Suite should be able to select the Indulgence meal package. Thus, users who select Single, Double, Queen, or King will only see a prompt to select meal packages 0 – 2, and users who select Master Suite will see a prompt to select meal packages 0 – 3 (one additional meal package).

  • Preliminary total cost is calculated as the sum of base room cost and the meal cost. For e.g., the preliminary total cost for 2 guests staying for 5 nights in the Master Suite who select the Indulgence package will be 5 + 850 = 1977.5.

  • AAA Discount: If the user is a AAA member, the program will apply a discount of 10% on the preliminary total cost. For example, a AAA member who has a preliminary total cost of $1977.5 will earn a AAA discount of $197.75.

  • Club Member Discount: If the user is a club member then the program will generate a random number between 0 (inclusive) and 10 (exclusive) and check whether the number is greater than or equal to 4. If so, the user will earn a discount on the base room price based on how many multiples of 4 nights they are staying (the program will show a message stating whether they won this discount or not). Any remaining nights that are not multiples of 4 do not count towards the discount. For instance:

    • If number of nights is 5, discount is 1 night’s price

    • If number of nights is 11, discount is 2 night’s prices

    • If number of nights is 3, discount is 0 night’s price

For e.g., suppose a club member staying in the Master Suite for 5 nights wins this discount. Then the club member discount for this user will be $225.5 (= price of 1 night for the Master Suite).

  • Calculate the total cost by subtracting the sum of AAA discount (if any) and club member discount (if any) from the preliminary total cost. For e.g., if the preliminary total cost is $1977.5, the club member discount is $225.5 and the AAA discount is $197.75, then the total cost is 5 - (197.75 + 225.5) = $1554.25.

 

Important Additional Instructions

The following are some additional instructions to make sure your project complies with specifications:

  1. Your program must use at least one switch() statement one boolean

  2. Your program must produce an output that exactly resembles the Sample Output shown below, including identical wording of prompts, spacing, input locations, etc.

  3. Your program must ensure the following:

    1. If the user is a club member, the program must display a message stating whether they won the club member discount. See sample run 1 (lines 14-15) for the positive message, and sample run 2 (lines 14-15) for the negative message. If user is not a club member no message is displayed as shown in sample run 3 (lines 13-14).

    2. The Indulgence meal package option is not shown when the user does not select the Master Suite. The corresponding prompt to select the meal package is also different for each case. See differences between sample runs 1 and 2. More specifically, sample run 1 (lines 17-21) shows the Indulgence package that is not shown in sample run 2 (lines 17-20). Also, the prompt to select the package in sample run 1 (line 23) provides options 0/1/2/3, which is different in sample run 2 (line 22) that only provides the options 0/1/2.

    3. Meal cost is not shown during checkout if the user selects the complementary package (see sample run 3, lines 20-21).

    4. Only discounts that are applicable are displayed during checkout. See sample runs 1 (lines 29-30), 3 (line 25) and 4 (line 29). More specifically, if a discount value is 0 or not selected, then that corresponding line is omitted in the checkout print statements. Additionally, if no discounts were applied, a special message is displayed. See sample run 2 (line 28).

 

  1. Before you submit, in Eclipse, type CTRL-A (to select everything) followed by a CTRL-I (to fix indentation) on BobcatHotel.java. In MacOS the corresponding keystrokes are Cmd-A followed by Cmd-I.

 

Sample Runs (user input shown in green, with each run separated by a dashed-line):

----------------------------------------SAMPLE RUN 1---------------------------------------

  • ROOM OPTIONS

  • Single @ $50.50 per night

  • Double @ $75.00 per night

  • Queen @ $100.75 per night

  • King @ $150.25 per night

  • Master Suite @ $225.50 per night 7

  • Please specify the number of guests: 2

  • Please select your room choice (enter 1/2/3/4/5 corresponding to the options shown above): 5

  • Please enter the number of nights: 5

  • Are you a AAA member (enter 1 for yes, 0 for no)? 1

  • Are you a club member (enter 1 for yes, 0 for no)? 1 13

  • Congratulations! You've qualified for our "Stay 4 nights get 1 free promotion"

  • Discount will be applied during checkout depending on the number of days 16

  • MEAL PACKAGES (PRICES SHOWN ARE PER GUEST PER NIGHT)

  • Complementary @ $0 per guest

  • Standard @ $30 per guest

  • Deluxe @ $50 per guest

  • Indulgence @ $85 per guest 22

23 Please select your desired meal package (enter 0/1/2/3 corresponding to the options shown above): 3

24

  • CHECKOUT

  • Room Cost: $1127.5

  • Meal Cost: +$850.0

  • Preliminary Total Cost: $1977.5

  • AAA Discount: -$197.75

  • Club Member Discount: -$225.5

  • Total Cost of Booking: $1554.25

----------------------------------------SAMPLE RUN 2---------------------------------------

  • ROOM OPTIONS

  • Single @ $50.50 per night

  • Double @ $75.00 per night

  • Queen @ $100.75 per night

  • King @ $150.25 per night

  • Master Suite @ $225.50 per night 7

  • Please specify the number of guests: 3

  • Please select your room choice (enter 1/2/3/4/5 corresponding to the options shown above): 3

  • Please enter the number of nights: 13

  • Are you a AAA member (enter 1 for yes, 0 for no)? 0

  • Are you a club member (enter 1 for yes, 0 for no)? 1 13

  • Unfortunately, you didn't qualify for our "Stay 4 nights get 1 free promotion".

  • Better luck next time! 16

  • MEAL PACKAGES (PRICES SHOWN ARE PER GUEST PER NIGHT)

  • Complementary @ $0 per guest

  • Standard @ $30 per guest

 

  • Deluxe @ $50 per guest 21

22 Please select your desired meal package (enter 0/1/2 corresponding to the options shown above): 1

23

24 CHECKOUT

25 Room Cost:                   $1309.75

26 Meal Cost:                  +$1170.0

  • Preliminary Total Cost: $2479.75

  • No Discounts Applied

  • Total Cost of Booking: $2479.75

----------------------------------------SAMPLE RUN 3---------------------------------------

  • ROOM OPTIONS

  • Single @ $50.50 per night

  • Double @ $75.00 per night

  • Queen @ $100.75 per night

  • King @ $150.25 per night

  • Master Suite @ $225.50 per night 7

  • Please specify the number of guests: 1

  • Please select your room choice (enter 1/2/3/4/5 corresponding to the options shown above): 4

  • Please enter the number of nights: 3

  • Are you a AAA member (enter 1 for yes, 0 for no)? 1

  • Are you a club member (enter 1 for yes, 0 for no)? 0 14

  • MEAL PACKAGES (PRICES SHOWN ARE PER GUEST PER NIGHT)

  • Complementary @ $0 per guest

  • Standard @ $30 per guest

  • Deluxe @ $50 per guest 19

20 Please select your desired meal package (enter 0/1/2 corresponding to the options shown above): 0

21

  • CHECKOUT

  • Room Cost: $450.75

  • Preliminary Total Cost: $450.75

  • AAA Discount: -$45.075

  • Total Cost of Booking: $405.675

----------------------------------------SAMPLE RUN 4---------------------------------------

  • ROOM OPTIONS

  • Single @ $50.50 per night

  • Double @ $75.00 per night

  • Queen @ $100.75 per night

  • King @ $150.25 per night

  • Master Suite @ $225.50 per night 7

  • Please specify the number of guests: 4

  • Please select your room choice (enter 1/2/3/4/5 corresponding to the options shown above): 5

  • Please enter the number of nights: 23

  • Are you a AAA member (enter 1 for yes, 0 for no)? 0

  • Are you a club member (enter 1 for yes, 0 for no)? 1 13

  • Congratulations! You've qualified for our "Stay 4 nights get 1 free promotion"

  • Discount will be applied during checkout depending on the number of days 16

  • MEAL PACKAGES (PRICES SHOWN ARE PER GUEST PER NIGHT)

  • Complementary @ $0 per guest

  • Standard @ $30 per guest

  • Deluxe @ $50 per guest

 

 

What to hand in

When you are done with this project, submit all your work through CatCourses.

 

Before you submit, make sure you have done the following:

  1. Attached the java file.

  2. Filled in your collaborator’s name (if any) in the “Comments…” text-box (if any) at the submission page.

 

Also, remember to demonstrate your code to the TA or instructor before the end of the demo period.

Attachments:
(5/5)

Related Questions

CSI 1420 Introduction to C Programming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Fu

The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Assignment To Be Done By Our ExpertsGet A+ Grade Solution Guaranteed

expert
joyComputer science
(4/5)
12 Answers Hire Me
expert
Robert DLaw
(4.8/5)
595 Answers Hire Me
expert
Dr Samuel BarberaStatistics
(5/5)
747 Answers Hire Me
expert
Tutor For YouEconomics
(5/5)
539 Answers Hire Me