Project description This unit\'s project builds atop of what you implemented on
ID: 3918228 • Letter: P
Question
Project description This unit's project builds atop of what you implemented on the previous unit. However, you will be adding instance variables and methods (including setters and getters) to your existing classes. Follow the step-by-step instructions and submit your running code via Moodle (If you have difficulties understanding the reason behind each step, consult your textbook or your instructor for clarification). Step 1: Working with Employee classes For more information please visit: https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html https://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html Abstract method of the class: calculatePay(). This abstract methods will be defined within FullTime and PartTime classes as these both classes are subclasses of Employee (abstract) class. After this step, you will get some error notifications on FullTime and PartTime class. Step 2: Working with FullTime and PartTime classes Since Employee class is an Abstract class and it has an abstract method ‘calculatePay’, it is mandatory that ‘calculatePay’ be implemented by ALL subclasses. ...you may use Netbeans method autogenerator... ... or simply define calculatePay() method in FullTime and PartTime class. ... But the error / warning is still there .... Reason: Method signature must be exactly the same as the one defined in parent class. Add double as return type and make sure all semi-colons and curly-braces are properly placed. The error should now disappear. Generate getters and setters as shown in unit 5. Define the FullTime class constructor(s): Follow the same steps used in FullTime to work with PartTime class. Follow Snapshot below. Implement abstract method of Employee class. Generate getters and setters. Define the PartTime class constructor(s): Step 3: Working with Vehicle class Define the Vehicle Generate getters and setters:
Explanation / Answer
In order for me to complete this assignment, you need to provide me the existing implementation of Employee.java, FullTime.java, PartTime.java. Once you provide me these implementations, then only I can answer your question correctly. For time being, I am providing you some sample implementations of the classes.
abstract class Employee {
private String ID;
private String name;
private String address;
private String department;
public Employee(String iD, String name, String address, String department) {
ID = iD;
this.name = name;
this.address = address;
this.department = department;
}
/**
* @return the iD
*/
public String getID() {
return ID;
}
/**
* @param iD the iD to set
*/
public void setID(String iD) {
ID = iD;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the address
*/
public String getAddress() {
return address;
}
/**
* @param address the address to set
*/
public void setAddress(String address) {
this.address = address;
}
/**
* @return the department
*/
public String getDepartment() {
return department;
}
/**
* @param department the department to set
*/
public void setDepartment(String department) {
this.department = department;
}
abstract double calculatePay();
}
class FullTime extends Employee {
public FullTime(String iD, String name, String address, String department) {
super(iD, name, address, department);
}
@Override
double calculatePay() {
return 0;
}
}
class PartTime extends Employee {
public PartTime(String iD, String name, String address, String department) {
super(iD, name, address, department);
}
@Override
double calculatePay() {
return 0;
}
}
NOTE: Please provide me the java implementations so that I can update the answer for you as soon as possible.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.