Question
Would you please help with a step by step solution with Java Programming Chapter 4 Case 1 Carly's Catering? a. Carlys Catering provides meals for
Would you please help with a step by step solution with Java Programming Chapter 4 Case 1 "Carly's Catering"?
a. Carlys Catering provides meals for parties and special events. In Chapter 3, you created an Event class for the company. The Event class contains two public final static fields that hold the price per guest(35) and the cutoff value for a large event (50 guests), and three private fields that hold an event number, number of guests for the event, and the price. It also contains two public set method and three public get methods.
Now, modify the Event class to contain two overloaded constructors.
One constructor accepts an event number and number of guests as parameters. Pass these values to the setEventNumber() and setGuests() methods, repectively. The setGuests() method will automatically calculate the event price.
The other constructor is a default constructor that passes A000 and 0 to the two-parameter constructor. Save the files as Event.java.
b. In Chapter 3, you also created an EventDemo class to demonstrate using two Event objects. Now, modify that class to instantiate two Event objects, and include the following new methods in the class.
Instantiate one object to retain the constructor default values.
Accept user data for the event number and guests fields, and use this data set to instantiate the second object. Display all the details for both objects.
Save the files as EventDemo.java
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