Question: Netbeans The assignment: The ABC Cheap Lodging, Inc wants a computerized printed receipt for each of its customers transaction, and a summary report for all
Netbeans
The assignment: The ABC Cheap Lodging, Inc wants a computerized printed receipt for each of its customers transaction, and a summary report for all its transactions.
Each input consists of the room number, the number of nights, and the number of customers. A customer may request additional night stay after the initial stay has expired. Also, a customer may have other members joining at a later time than at the initial registration.
When registering, if customer a simply request a room it is assumed that its only one person staying one night. On the other hand the customer may specify the length of stay. In this case it is assumed that there is only one customer for that many nights; or the customer may specify the length of stay and the number of guests. See rate table below for the various charges.
Welcome to ABC Cheap Lodging, Inc Rates Table
ROOM $81.95 (per person)
TAX 6.5% (applies to room cost only)
TELEPHONE .... $5.75 (Flat rate)
MEAL ... $ 14.95 (per person, per day)
TIP .9.5% (cover all charges)
(a) Use the class Hotel given in the notes as the basis for this assignment. You will have to add the necessary codes (variables and methods) to add more nights and more customers. Refer to the test class to see what the names of the methods are.
(b) Use the test class TestHotel and complete the definition for the overloaded method display that prints the summary report. You determine and define the variables and methods necessary in the Hotel class that will be used for the summary report.
Note: Uncomment the statements for this incomplete test class. When complete, the program should generate out as shown in Figure 1.
//import java.util.Date;
//import java.text.DateFormat;
//import java.text.NumberFormat;
//class TestHotel
//{ //public static void main(String[] arg)
//{ //NumberFormat f = NumberFormat.getCurrencyInstance();
// Create customer objects, calculate amounts, display receipts
//Hotel customer1 = new Hotel("10 - M", 2, 2); //customer1.calculate();
//display(customer1, f);
//Hotel customer2 = new Hotel("12 - B");
//Hotel customer3 = new Hotel("12 - C", 2);
//customer3.calculate();
//customer2.addNights(1);
//customer2.calculate();
//display(customer2, f);
//customer3.addGuest(1);
//customer3.calculate();
//display(customer3, f);
//display(f);
//} //static void display(Hotel h, NumberFormat f)
//{
// Set up and display heading and date for each receipt
// System.out.println("\tThe ABC Cheap Lodging, Inc");
// Date d = new Date();
// DateFormat df = DateFormat.getDateInstance();
// System.out.println("\tDate: \t" + df.format(d));
// Display expenses line by line including subtotal as shown in the output
//Display to total // System.out.println(" TOTAL AMOUNT DUE\t.........." + f.format(h.getTotal()));
// Display thank you message
// System.out.println(" Thanks for staying at The ABC Cheap Lodging, Inc" );
// System.out.println("\tPlease come again !!!"); // System.out.println(" "); }
//static void display(NumberFormat f)
//{
// Complete this method so that it displays the summary amounts as shown in the output
//} /
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
