Question: You'll have to use this code import java.text.NumberFormat; public class PartyTest { public static void main(String[] args) { NumberFormat f = NumberFormat.getCurrencyInstance(); PartyVenue ballroom =

 You'll have to use this code import java.text.NumberFormat; public class PartyTest
{ public static void main(String[] args) { NumberFormat f = NumberFormat.getCurrencyInstance(); PartyVenue
You'll have to use this code
import java.text.NumberFormat;
public class PartyTest
{
public static void main(String[] args)
{
NumberFormat f = NumberFormat.getCurrencyInstance();
PartyVenue ballroom = new PartyVenue("Hotel Ballroom", 125.50);
PartyVenue church = new PartyVenue("Church Basement", 10.00);
PartyVenue hall = new PartyVenue("Community Hall", 65.00);
Party bobsRetirement = new Party("Nov 5, 2010","6 pm", 3, hall, 20);
Party andrewsBookLaunch=new Party("Sept 16, 2011","7 pm", 4, ballroom, 250);
ChildBirthdayParty chelseasParty = new ChildBirthdayParty("Dec 18, 2010",
"2 pm",
2,
church,
9,
"Chelsea",
8,
"Princess Tea Party");
ChildBirthdayParty tommiesParty = new ChildBirthdayParty("Nov 30, 2010",
"8 pm",
3,
hall,
18,
"Tommy",
14,
"Guitar Hero Mania");
// Test venue methods...
System.out.println("Current Venue Status:");
System.out.println("=====================");
System.out.println(ballroom.getLocation()
+ ": Hourly Rate: "
+ f.format(ballroom.getHourlyRate()));
System.out.println(church.getLocation()
+ ": Hourly Rate: "
+ f.format(church.getHourlyRate()));
System.out.println(hall.getLocation()
+ ": Hourly Rate: "
+ f.format(hall.getHourlyRate()));
hall.setHourlyRate(75.00);
System.out.println(" After changing the rate:");
System.out.println("========================");
System.out.println(hall.getLocation()
+ ": Hourly Rate: "
+ f.format(hall.getHourlyRate()));
System.out.println(" Current Party Status:");
System.out.println("=====================");
System.out.println("Bob's Retirement:");
System.out.println(bobsRetirement.getDate());
System.out.println(bobsRetirement.getTime());
System.out.println(bobsRetirement.getLength() + " hours long");
System.out.println(bobsRetirement.getVenue().getLocation());
System.out.println(bobsRetirement.getNumAttending() + " attendees");
System.out.println("Cost: " + f.format(bobsRetirement.getTotalCost()));
System.out.println(" ...and after adding 10 more guests:");
bobsRetirement.setNumAttending(bobsRetirement.getNumAttending() + 10);
System.out.println("Cost: " + f.format(bobsRetirement.getTotalCost()));
System.out.println(" Current Birthday Party Status:");
System.out.println("==============================");
System.out.println("Birthday party for: "
+ chelseasParty.getGuestOfHonour());
System.out.println(chelseasParty.getDate());
System.out.println(chelseasParty.getTime());
System.out.println(chelseasParty.getLength() + " hours long");
System.out.println(chelseasParty.getVenue().getLocation());
System.out.println(chelseasParty.getNumAttending() + " attendees");
System.out.println(chelseasParty.getAge() + " years old");
System.out.println("Theme: " + chelseasParty.getTheme());
System.out.println("Cost: " + f.format(chelseasParty.getTotalCost()));
System.out.println(" ...and after 2 guests were unable to attend:");
chelseasParty.setNumAttending(chelseasParty.getNumAttending() - 2);
System.out.println("Cost: " + f.format(chelseasParty.getTotalCost()));
} // end main method
} // end PartyTest class

Party Planning A friend of yours has just opened her own party-planning company. She has asked you to write software to help manage her new business. You have decided to begin by writing three classes, named: - PartyVenue - Party, and - ChildBirthdayParty. A PartyVenue represents a location where a party might be held. For each party venue, we need to record: 1. a textual description of the location (e.g. "Queen Anne Hotel Main Ballroom"); and 2. the rental rate per hour (e.g. 125.50) Accessor methods should be provided to retrieve this information when required. Also, your class should provide support for changing the rental rate. Each Party must have: 1. a date (stored as a String, for example "20/12/2009"); 2. a start time (stored as a String, for example 7:00 p.m."): 3. an estimated duration in hours (e.g. 5); 4. a PartyVenue; and 5. the number of guests who have been invited. In addition to the venue rental fee, the party-planning company also charges additional fees (to cover the cost of food, decorations, and the planner's fime). The party-planning company's rates are as follows: For each party, we need appropriate methods to be able to retrieve the following: - date; - start time; - duration; - venue description; - number of guests; - the total venue rental fee (for the full duration of the party); and - the total cost of the party, which includes both the venue rental fee and the partyplanning company's fees. Your friend has noted that her company handles children's birthday parties a bit differently than other parties. She says that all of the information stored in the Party class is still important. However, for a ChildBirthdayParty she must also record: 1. the name of the guest of honour (e.g. "Bobby Smith"); 2. the child's age (e.g. 6); and 3. a theme (e.g. "Cowboy" or "Under the Sea")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!