Question: You developed classes that work with catering event information for Carlys Catering. Now modify the Event and EventDemo classes as follows: Modify the Event class

You developed classes that work with catering event information for Carly’s Catering. Now modify the Event and EventDemo classes as follows:

  • Modify the Event class to include an integer field that holds an event type. Add a final String array that holds names of the types of events that Carly’s caters—wedding, baptism, birthday, corporate, and other. Include get and set methods for the integer event type field. If the argument passed to the method that sets the event type is larger than the size of the array of String event types, then set the integer to the element number occupied by other. Include a get method that returns an event’s String event type based on the numeric event type.
  • To keep the EventDemo class simple, remove all the statements that compare event sizes and that display the invitation Strings. 
  • Modify the EventDemo class so that instead of creating three single Event objects, it uses an array of three Event objects. Get data for each of the objects, and then display all the details for each object. Save the files as Event.java and EventDemo.java.

Step by Step Solution

3.52 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

class Event public final static double HIGHGUESTPRICE 3500 public final static double LOWGUESTPRICE 3200 public final static int LARGEEVENT 50 public final static int EVENTNUMLENGTH 4 public final sta... View full answer

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 Java Programming Questions!