Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In previous chapters, you have created several classes for Carly's Catering. Now, create a new abstract class named Employee. The class contains data fields for

In previous chapters, you have created several classes for Carly's Catering. Now, create a new abstract class named Employee. The class contains data fields for an employee's ID number, last name, first name, pay rate, and job title. The class contains get and set methods for each field; the set methods for pay rate and job title are abstract. Save the file as Employee.java.

b. Create three classes that extend Employee named Waitstaff, Bartender, and Coordinator. The method that sets the pay rate in each class accepts a parameter and assigns it to the pay rate, but no Waitstaff employee can have a rate higher than 10.00, no Bartender can have a rate higher than 14.00, and no Coordinator can have a rate higher than 20.00. The method that sets the job title accepts no parametersit simply assigns the string waitstaff, bartender, or coordinator to the object appropriately. Save the files as Waitstaff.java, Bartender.java, and Coordinator.java.

c. In Chapter 10, you created a DinnerEvent class that holds event information, including menu choices. Modify the class to include an array of 15 Employee objects representing employees who might be assigned to work at a DinnerEvent. Include a method that accepts an Employee array parameter and assigns it to the Employee array field, and include a method that returns the Employee array. The filename is DinnerEvent.java.

d. Write an application that declares a DinnerEvent object, prompts the user for an event number, number of guests, menu options, and contact phone number, and then assigns them to the object. Also prompt the user to enter data for as many Employees as needed based on the number of guests. A DinnerEvent needs one Waitstaff Employee for every event, two if an event has 10 guests or more, three if an event has 20 guests or more, and so on. A DinnerEvent also needs one Bartender for every 25 guests and one Coordinator no matter how many guests attend. All of these Employees should be stored in the Employee array in the DinnerEvent object. (For many events, you will have empty Employee array positions.) After all the data values are entered, pass the DinnerEvent object to a method that displays all of the details for the event, including all the details about the Employees assigned to work. Save the program as StaffDinnerEvent.java.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions