Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

Question Can any type of stock or securities be used in an ESOP?

Answered: 1 week ago

Question

Question Can a self-employed person adopt a money purchase plan?

Answered: 1 week ago