• Log in or sign up for an account here: https://www.sythe.org/login

Looking for Java Help. Easy

fpla

Apprentice
Joined
Jun 8, 2011
Sythe Gold
342
Messages
719
If someone can help me, I would be very willing to pay through paypal, or pro bono for those kind hearted people who could help explain this to me please.

If interested please leave your contact details or send me a PM (best method) and we can move from there.

Also important to note is that we use 'NetBeans' for coding.

My assignment parameters:

After answering this assignment you will be able to:
(a) Distinguish between instance variables and class variables
(b) Distinguish between instance methods and class methods
(c) Know how to call class methods and how to call instance methods
(d) Format numbers to reflect dollar currency
(e) Format current date
(f) Understand the concept of overloading

The ABC Cheap Lodging, Inc wants a computerized printed receipt for each of its customer’s 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 it’s 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.


172WK






(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: You must uncomment the statements for the program to compile

//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
// System.out.println("Room# \t\t\t\t" + h.getRoomNumber());
// System.out.println("Room Rate\t\t\t" + f.format(h.getRoomRate()));
// System.out.println("Length of stay\t\t" + h.getNumberOfNights() + " night(s)");
// System.out.println("No. of guests\t\t" + h.getNumberOfGuests());
// System.out.println("Room cost\t\t\t" + f.format(h.getAmountDue()));
// System.out.println("Tax" + h.getTaxRate() + "%\t\t\t\t" + f.format(h.getTaxDue()));
// System.out.println("\tSubtotal \t\t\t" + f.format(h.getSubtotal()));
// System.out.println("Telephone \t\t\t" + f.format(h.getPhoneCharges()));
// System.out.println("Meal charges \t\t" + f.format(h.getMeal()));
// System.out.println("Tip \t\t\t\t" + f.format(h.getTip()));

//Display to total
// System.out.println("\nTOTAL AMOUNT DUE\t.........." + f.format(h.getTotal()));

// Display thank you message
// System.out.println("\nThanks for staying at The ABC Cheap Lodging, Inc" );
// System.out.println("\tPlease come again !!!");
// System.out.println("\n");
}
//static void display(NumberFormat f)
//{
// Complete this method so that it displays the summary amounts as shown in the output

//}

//}

Figure 1

1732a

1732r
 
PHP Shit Show 2k26
I can do this pm me with your offer.
 
Runescape Gamblingrunescape gambling
Back
Top