Looking for Java Help. Easy

Discussion in 'Programming General' started by fpla, Sep 20, 2012.

Looking for Java Help. Easy
  1. Unread #1 - Sep 20, 2012 at 6:58 PM
  2. fpla
    Joined:
    Jun 8, 2011
    Posts:
    719
    Referrals:
    2
    Sythe Gold:
    342
    Discord Unique ID:
    206942888800681984
    Discord Username:
    fireheart#1482

    fpla Apprentice

    Looking for Java Help. Easy

    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.


    [​IMG]





    (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

    [​IMG]
    [​IMG]
     
  3. Unread #2 - Sep 21, 2012 at 12:22 AM
  4. iJava
    Joined:
    Nov 21, 2011
    Posts:
    1,197
    Referrals:
    11
    Sythe Gold:
    485
    Discord Unique ID:
    220055593568829441

    iJava .Previously known as RSGoldRush
    $200 USD Donor New

    Looking for Java Help. Easy

    I can do this pm me with your offer.
     
  5. Unread #3 - Sep 21, 2012 at 5:13 AM
  6. iJava
    Joined:
    Nov 21, 2011
    Posts:
    1,197
    Referrals:
    11
    Sythe Gold:
    485
    Discord Unique ID:
    220055593568829441

    iJava .Previously known as RSGoldRush
    $200 USD Donor New

    Looking for Java Help. Easy

    Did you email me?
     
  7. Unread #4 - Sep 21, 2012 at 9:58 AM
  8. fpla
    Joined:
    Jun 8, 2011
    Posts:
    719
    Referrals:
    2
    Sythe Gold:
    342
    Discord Unique ID:
    206942888800681984
    Discord Username:
    fireheart#1482

    fpla Apprentice

    Looking for Java Help. Easy

    I haven't had a chance - Just pmed you.
     
  9. Unread #5 - Oct 29, 2012 at 1:34 AM
  10. Matty ICE
    Joined:
    Oct 29, 2012
    Posts:
    1,064
    Referrals:
    0
    Sythe Gold:
    7

    Matty ICE Guru
    Banned

    Looking for Java Help. Easy

    I can complete this for you if you still need it. I am a Sophomore at Illinois State studying Java programming.

    My MSN: [email protected]
     
  11. Unread #6 - Oct 29, 2012 at 4:10 AM
  12. iJava
    Joined:
    Nov 21, 2011
    Posts:
    1,197
    Referrals:
    11
    Sythe Gold:
    485
    Discord Unique ID:
    220055593568829441

    iJava .Previously known as RSGoldRush
    $200 USD Donor New

    Looking for Java Help. Easy

    It's been done.
     
< Free editors/Ide's | How do I fix this? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site