subject

Design two subclasses of Employee…SalariedEmployee and HourlyEmployee. A salaried employee has an annual salary attribute. An hourly employee has an hourly pay rate attribute, an hours worked attribute, and an earnings attribute. An hourly employee that works more than 40 hours gets paid at 1.5 times their hourly pay rate. You will decide how to implement constructors, getters, setters, and any other methods that might be necessary. 1. (20 points) Draw a UML diagram for the classes. 2. (80 points) Implement the classes, and write a test program that creates a salaried employee and two hourly employees. One of the hourly employees should have hours worked set to less than 40 and one should have hours worked set to more than 40. The test program should display all attributes for the three employees. To keep things simple, the employee classes don’t need to do any editing.

public class Employee
{
private int empID;
Address address;
Name name;
Date date;

public Employee()
{
}

public Employee(int empID)
{
this. empID = empID;
}

public int getEmpID()
{
return empID;
}

public void setEmpID(int empID)
{
this. empID = empID;
}

public Address getAddress()
{
return address;
}

public void setAddress(Address address)
{
this. address = address;
}

public Name getName()
{
return name;
}

public void setName(Name name)
{
this. name = name;
}

public Date getDate()
{
return date;
}

public void setDate(Date date)
{
this. date = date;
}

}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:10
Consider a direct-mapped cache with 216 words in main memory. the cache has 16 blocks of 8 words each. it is a word-addressable computer (rather than a byte-addressable computer which we normally discuss). (a) how many blocks of main memory are there? (b) what is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, cache block, and block offset fields (if they apply)? (c) to which cache block will the memory reference db6316 map?
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Into what form does the barcode reader convert individual bar patterns?
Answers: 1
question
Computers and Technology, 25.06.2019 02:30
What does a trademark indicate about a product? a trademark is a sign, symbol, or short phrase that indicates the of a product or service. type the correct answer in the box
Answers: 1
You know the right answer?
Design two subclasses of Employee…SalariedEmployee and HourlyEmployee. A salaried employee has an an...
Questions
question
Mathematics, 05.06.2020 07:57
question
Mathematics, 05.06.2020 07:57
question
Mathematics, 05.06.2020 07:57
question
Social Studies, 05.06.2020 07:57
question
Mathematics, 05.06.2020 07:57
Questions on the website: 13722367