Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Console Application: Yeppoon Budget Cabins are offering cabins at $89.95 per night. For each booking irrespective of the number of days there is a

Java Console Application:

Yeppoon Budget Cabins are offering cabins at $89.95 per night. For each booking irrespective of the number of days there is a one-off cleaning fee of $20.00.

If the customer books one night, the total charge will be $109.95, two nights will be $199.90 etc.

To encourage customers to book more nights, the management has decided to give a ten percent discount for a booking with more than seven nights and a fifteen percent discount with a booking of more than fourteen nights on the total nights of stay charge. This will not apply to the one-off cleaning fee.

Develop a Java Console Application (YeppoonCabins.java) which will allow staff to enter the details of N booking names and the number of nights. Use N=8. For each booking the program will prompt for and accept the booking name and the number of nights, it will then display the charge (see sample output below for formatting details).

When all the bookings have been entered you need to report the maximum and minimum number of nights per booking and the relevant booking name, the average number of nights per booking and the total charges which have been collected.

Required: Java Console Application should allow user to:

1. For each of the N bookings: enter the booking name, and then enter the number of nights. The

program will output the charge for the booking. All dollar values will be formatted to two decimal

places (see implementation below with help for doing this).

2. You must ensure the booking name is not blank so you must implement a validation loop to

ensure that a booking name is entered. There is no need to ensure the name is a valid name (e.g. entering 1 for the name would be allowed). The number of nights must be greater than or equal to one and you will also need to implement validation loop to ensure that a valid number of nights is entered.

3.When N bookings have been entered, you will output a heading for the statistics "Statistical information for Yeppoon Cabins", the minimum and maximum number of nights booked and the booking names with these minimums and maximums, and then what the average number of nights per booking is (formatted to two decimal places) (see sample output below). Note: If more than one booking has an equal maximum or minimum nights you just need to only output one of these cases.

4. Display a welcome message at the beginning "Welcome to the Yeppoon Cabins Management System" and an end message e.g. "Thank you for using the Yeppoon Cabins Management System" and the final line "Program written by " (see sample output below).

image text in transcribed

Cis. C:IWINDOWS Welcome to the Yeppoon Cabins Management System Please enter booking name 1 => ERROR booking name cannot be blank Please enter booking name 1==> ERROR booking name cannot be blank Please enter booking name 1 Bruce McKenzie Enter the number of nights for Bruce McKenzie =1 ERROR number of nights must be greater than or equal to 1 Enter the number of nights for Bruce McKenzie =8 The charge for Bruce McKenzie for 8 nights is $667.64 Please enter booking name 2 Nick Klomp Enter the number of nights for Nick Klomp =>3 The charge for Nick Klomp for 3 nights is $289.85 Please enter booking name 3 Jimmy Barnes Enter the number of nights for Jimmy Barnes =17 The charge for Jimmy Barnes for 17 nights is $1319.78 Statistical information for Yeppoon Cabins Nick Klomp has the minimum number of 3 nights Jimmy Barnes has the maximum number of 17 nights The average number of nights per booking is: 9.33 nights The total charges collected is $2277.27 Thank you for using the Yeppoon Cabins Management System Program written by 13022211

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

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

Students also viewed these Databases questions

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago