a. In Chapter 8, you created an Event class for Carlys Catering. Now extend the class to create a DinnerEvent class. In the extended class, include four new integer fields that represent numeric choices for an entre, two side dishes, and a dessert for each DinnerEvent object. Also include three final arrays that contain String menu options for entres, side dishes, and desserts, and store at least three choices in each array. Create a DinnerEvent constructor that requires arguments for an event number and number of guests, and integer menu choices for one entre, two side dishes, and one dessert. Pass the first two parameters to the Event constructor, and assign the last four parameters to the appropriate local fields. Also include a getMenu() method that builds and returns a String including the Strings for the four menu choices. Save the file as DinnerEvent.java.
b. In Chapter 9, you created an EventDemo program for Carlys Catering. The program uses an array of Event objects and allows the user to sort Events in ascending order by event number, number of guests, or event type. Now modify the program to use an array of four DinnerEvent objects. Prompt the user for all values for each object, and then allow the user to continuously sort the DinnerEvent descriptions by event number, number of guests, or event type. Save the file as DinnerEventDemo.java.
Criteria:
Include four new integer fields that represent numeric choices for One entree,
Two side dishes
One dessert for each DinnerEvent object.
Also include
Three final arrays that contain String menu options for entrees, side dishes, and desserts,
Store at least three choices in each array.
Create a DinnerEvent constructor that requires arguments for
An event numbernumber
Number of guests,
And integer menu choices for
one entree
two side dishes
one dessert.
Pass the first two parameters to the Event constructor, and assign the last four parameters to the appropriate local fields.
include a getMenu() method that builds and returns a String including the Strings for the four menu choices.
ncluded DinnerEventDemo.java source file to prove that your DinnerEvent class functions properly
Save the file as DinnerEvent.java.
Notes:
1. DinnerEvent.java should just be a few dozen lines of code
2. This assignment is as much an integration of existing code as it is writing new code. You will need to read and understand all of the sources provided.
Reviews
There are no reviews yet.