Question: This is a question for my assignment, please respond with the correct code as soon as you can. To be done on Java. Will upvote

This is a question for my assignment, please respond with the correct code as soon as you can. To be done on Java. Will upvote definitely, thanks!

Part A

/** A class to model an executive. */ public class Executive extends Manager { private int bonus; /** Make an executive with a given name, salary, department and bonus. @param name the name @param salary the salary @param department the department @param bonus the bonus */ public Executive(String name, double salary, String department, int bonus) { //-----------Start below here. To do: approximate lines of code = 2 // Initialize the inherited variables using the super() keyword // also initialize the new instance variable bonus //-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions. }

/** Provide a string description of an executive. */ public String toString() { //-----------Start below here. To do: approximate lines of code = 1 // Override the method toString() from super class Manager //Hint: use the super. (see toString() method in Manager) // and add " Bonus: " followed by the bonus value to the returned string //-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions. } }

Part B

/** A class to model a manager. */ public class Manager extends Employee { private String department;

/** Make a manager with a given name, salary, and department. @param name the name @param salary the salary @param department the department */ public Manager(String name, double salary, String dept) { //-----------Start below here. To do: approximate lines of code = 2 // Initialize the inherited variables name and salary using the super() keyword // initialize the new instance variable department //-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions. }

/** Provide a string description of a manager. */ public String toString() { //-----------Start below here. To do: approximate lines of code = 1 // Override the method toString() from super class Employee //Hint: use the super. (see toString() method in Employee) // and add " Department: " followed by the department name to the returned string //-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions. } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!