Question: Homework 1 0 Problem 1 . Modify the Firm example from this chapter such that all employees can be given different vacation options depending on
Homework
Problem Modify the Firm example from this chapter such that all employees can be given
different vacation options depending on their classification. Provide a method called vacation
that returns the number of vacation days a person has. Give all employees a standard number of
vacation days then override the method in the various employee classes as appropriate.
Modify the driver program to demonstrate this new functionality.
Problem Implement a class called BonusTooHighException, designed to be thrown when a
bonus value is greater than $ Using the Executive class from Chapter create a main
program that creates and populates an Executive array with information entered by the user
array size as well If a bonus value is entered that is too high, ie greater than $ throw
the exception. Allow the thrown exception to terminate the program.
Problem Modify the solution to the program above submit a second file for this such that it
catches and handles the exception if it is thrown. Handle the exception by printing an
appropriate message and keeping the bonus and then continue entering more executive data.
Let the program conclude by printing the total number of executives with valid bonuses, ie
positive, more than $ as well as the average pay.
NOTE: These problems do not require use of all the classes from Chapter
Since Executive is a child of Employee, StaffMember, you can copy the classes needed to your
homework folder.Homework
Problem Modify the Firm example from this chapter such that all employees can be given
different vacation options depending on their classification. Provide a method called vacation
that returns the number of vacation days a person has. Give all employees a standard number of
vacation days then override the method in the various employee classes as appropriate.
Modify the driver program to demonstrate this new functionality.
Problem Implement a class called BonusTooHighException, designed to be thrown when a
bonus value is greater than $ Using the Executive class from Chapter create a main
program that creates and populates an Executive array with information entered by the user
array size as well If a bonus value is entered that is too high, ie greater than $ throw
the exception. Allow the thrown exception to terminate the program.
Problem Modify the solution to the program above submit a second file for this such that it
catches and handles the exception if it is thrown. Handle the exception by printing an
appropriate message and keeping the bonus and then continue entering more executive data.
Let the program conclude by printing the total number of executives with valid bonuses, ie
positive, more than $ as well as the average pay.
NOTE: These problems do not require use of all the classes from Chapter
Since Executive is a child of Employee, StaffMember, you can copy the classes needed to your
homework folder.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
