Question: JAVA... THIS IS THE PARENT CLASS public class Person { String name; String company; int id; int hours; double rate; Person(String n, String c, int

JAVA... THIS IS THE PARENT CLASS

public class Person {

String name;

String company;

int id;

int hours;

double rate;

Person(String n, String c, int i, int h, double r)

{

name=n;

company=c;

id=i;

hours=h;

rate=r;

}

public void showInfo()

{

System.out.println("Name\t"+name);

System.out.println("Company\t"+company);

System.out.println("ID\t"+id);

System.out.println("Hours\t"+hours);

System.out.println("Rate\t"+rate);

}

public double calcSalary(int n)

{

return n*(hours*rate);

}}

JAVA VIA ECLIPSE....

Create a class called SalariedEmployee that inherits from Employee

It will have a double value for taxes

It will have a constructor as an argument constructor that will set all the values from super class and the taxes

It will have a showInfo method that will display all the values from the super class and this class

It will have a calcCost method that will take in the numberOfEmployees in the company and then return the cost from person minus the taxes per person that are deducted. That is what the total amount the company will pay out for the week for its employees.

In the main method create one object e1 and assign it at time of object creation any values you choose.

Output the values of each and also the cost (be sure to use the proper calls)

Create a second object e2 that will pass any values that you choose AFTER you type them in as questions interactively from the keyboard.

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!