Question
Java Programming edition 8, Chapter 4 case problem p.243-244 1a-b Carlys Project build from original. 1a. carlys catering provides meals for parties and special events.
Java Programming edition 8, Chapter 4 case problem p.243-244 1a-b Carlys Project build from original. 1a. 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 tghe price per guest ($35.00) 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 methods and three public get methods. Now modify the Event class to contain two overloaded constructors. Once constructor accepts an event number and number of guests as parameters. Pass these values to the setEventNumber() and setGuests() methods, respectively. 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 file as Event.java. 1b. 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 guest fields, and use this data set to instantiate the second object. Display all the details for both objects. Save file 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