Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

Why does sin 2x + cos2x =1 ?

Answered: 1 week ago

Question

What are DNA and RNA and what is the difference between them?

Answered: 1 week ago

Question

Why do living creatures die? Can it be proved that they are reborn?

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago