Question: Create a CateringEvent class with the following class/instance variables (all private) : a String for the event name an int for the number of guests

Create a CateringEvent class with the following class/instance variables (all private):

  • a String for the event name
  • an int for the number of guests
  • a double for the price per guest
  • you should NOT have a total cost instance variable or whether the event is considered a large event

The CateringEvent class should also have the following public methods:

  • a static displayBanner() method that prints out the banner/sign with the slogan (like you had in Unit1 CateringSign program)
  • get/set methods for event name, number of guests, and price per guest
  • a method to calculate and return the total cost of the event
  • a constructor that takes as parameters an event name and the number of guests, and sets the price per guest to the default value of $35.00.

Create a CateringEventDemo class that:

  • In the main() method prints out the Catering sign, creates three different CateringEvent objects by calling the askUser() method below, and then displaying output for the object by calling the display() method below.
  • Create a separate static display() method in CateringEventDemo to display the Catering information for an object, including the total charges.
  • Create a separate static askUser() method displays the catering sign, asks the user (using the Scanner class) for the event name, and # guests, creates a CateringEvent object and sets those properties in the object using the your constructor, and returns the object to the main() method.

Example Output:

Jane's Birthday Party will have 55 guests and will cost $1925.00.

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!