Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started