Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a . In previous chapters, you developed classes that work with catering event information for Yummy Catering. Now modify the Event class to include an
a In previous chapters, you developed classes that work with catering event information for Yummy Catering. Now 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 Yummy caterswedding 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. Save the file as Event.java.
b Create an EventDemo class that uses an array of eight Event objects. Get data for each of the objects, including an integer for the event type. Prompt the user to choose an option to sort Events in ascending order by event number, number of guests, or event type. Display the sorted list of Events, including Event number, number of guests, price per guest, total price, phone number, Event type number, and Event type String. Continue to prompt the user for sorting options and display the requested lists until the user enters a sentinel value. Save the file as EventDemo.java.
Create a zip file of the java files and submit the assignment.
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