Home / Expert Answers / Computer Science / in-java-please-here-are-the-entire-set-of-classes-i-used-for-a-previous-assignment-that-i-pa873

(Solved): In JAVA Please! Here are the entire set of classes I used for a previous assignment that I ...



In JAVA Please!

\( { }^{*} \) Programming Problem 3: Interface and Inheritance - More People
This assignment covers concepts related to inher

our Tasks:
1. Following the specifications given in the following detailed UML diagram, develop or modify all required classe

Design AdjunctFaculty class to include attributes and methods:
- perCreditRate: double
- Accessor and mutator methods for per

Here are the entire set of classes I used for a previous assignment that I am allowed to use and modify for this assignment:

Staff.java

public class Staff {
public static void main(String[] args) {
Person[] group = new Person[5];
group[0] = new Student("Mary Jane", 234);
group[1] = new Person("Joe Smith");
group[2] = new Employee("Anna Smiley", 23234);
group[3] = new Faculty("Jane Dane", 2343, "Lecturer");
group[4] = new Undergraduate("Edward Stone", 121, "Business");
for (Person p : group) {
System.out.println(p);
System.out.println();
}
}
}

Person.java

public class Person {
private String name;

public Person() {
}

public Person(String name) {
this.name = name;
}

public String getName() {
return name;
}

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

@Override
public String toString() {
return "Name: " + name + "\n";
}
}

Student.java

public class Student extends Person {
private int studentNumber;

public Student() {
super();
}

public Student(String name, int studentNumber) {
super(name);
this.studentNumber = studentNumber;
}

public int getStudentNumber() {
return studentNumber;
}

public void setStudentNumber(int studentNumber) {
this.studentNumber = studentNumber;
}

@Override
public String toString() {
return super.toString() + "StudentNumber: " + studentNumber + "\n";
}
}

Undergraduate.java

public class Undergraduate extends Student {
private String major;

public Undergraduate() {
super();
}

public Undergraduate(String name, int studentNumber, String major) {
super(name, studentNumber);
this.major = major;
}

public String getMajor() {
return major;
}

public void setMajor(String major) {
this.major = major;
}

@Override
public String toString() {
return super.toString() + "Undergraduate major: " + major + "\n";
}
}

Employee.java

public class Employee extends Person {
private int empID;

public Employee() {
super();
}

public Employee(String name, int empID) {
super(name);
this.empID = empID;
}

public int getEmpID() {
return empID;
}

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

@Override
public String toString() {
return super.toString() + "Employee ID: " + empID + "\n";
}
}

Faculty.java

public class Faculty extends Employee {
private String rank;

public Faculty() {
super();
}

public Faculty(String rank) {
this.rank = rank;
}

public Faculty(String name, int empID, String rank) {
super(name, empID);
this.rank = rank;
}

public String getRank() {
return rank;
}

public void setRank(String rank) {
this.rank = rank;
}

@Override
public String toString() {
return super.toString() + "Faculty Rank: " + rank + "\n";
}
}

Programming Problem 3: Interface and Inheritance - More People This assignment covers concepts related to inheritance, polymorphism, and interfaces. As you have learned, a class cannot inherit from more than one superclass. However, any class can extend a superclass, and implement an interface, which allows classes in your program to have common attributes and methods through inheritance, and add more common behavior by implementing interfaces. This programming problem will allow you to experiment with this technique by adding on your Guided Assignment number 3. Given that the interface methods are implemented at the subclass level, the definition of the superclasses has to reflect that they do not have implementations of these methods. The new UML class diagram contains additional classes that you will need design: To solve this problem and save some time, you can use the entire set of classes you used in the guided assignments. However, you will need to modify them. our Tasks: 1. Following the specifications given in the following detailed UML diagram, develop or modify all required classes: - Design the Payroll interface, having the following two methods: - calculateMonthlyGrossPay(): double - displayPaylnfo(): void - displays the information of the employee, followed by the information about the pay for a month - Modify Person.java to show that it implements Payroll interface - you may leave the body of the interface methods empty in the Person class allowing the derived classes to have specific implementations. - Modify Student, Employee, and Faculty to express the fact that they inherit behavior from Person that includes Payroll. You do not implement any of the methods from the Payroll interface in any of these classes. - Design Graduate class as a subclass of Student. - This class inherits the attributes and behavior of Student. - The class has an additional attribute: - department: String - the department student is registered in. - Create the accessor and mutator methods for a new attribute. - Override the method toString() to include information about the new attribute. - Design GTA class, standing for Graduate Teaching Assistant, as a subclass of Graduate, to include: - hourlySalary: double - holding the GTA salary position - Accessor and mutator methods for hourlySalary - calculateMonthlyGrossPay(): double - calculateMonthlyGrossPay(int weeklyHours): double - displayPayInfo(): void - Do not override the toString method of superclass Graduate. The payment information will be only accessed to specific payroll methods - Design FullTimeFaculty class to include attributes and methods: - salary: double - Accessor and mutator methods for salary - implementation of both methods in the Payroll interface - Do not override the toString method of superclass Faculty. The payment information will be only accessed to specific payroll methods. Design AdjunctFaculty class to include attributes and methods: - perCreditRate: double - Accessor and mutator methods for perCreditRate - Implementation of both methods in the Payroll interface. For adjunct faculty, the salary for a semester has two pays, so it will be calculated as noCredits* perCreditRate/2 - Do not override the toString method of superclass Faculty. The payment information will be only accessed to specific payroll methods 2. Create a driver program similar to the one given in the guided assignment 3 , named Personnel.java, that includes: - Define and instantiate three objects as follows: - p1 - type GTA, working 40 hours - p2 - type FullTimeFaculty paid for 4 weeks - p3 - type AdjunctFaculty paid for 12 credits 3. Display information about all object declared. 4. Display the payment information for a month. 5. Compile all classes, run the driver program, and take a snapshot of the result. 6. If you implement all the required methods properly, the driver program should generate outputs similar to the following:


We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe