Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please show your work and show the final display output. Thank you. In this assi

ID: 3729792 • Letter: P

Question

Please show your work and show the final display output. Thank you.

In this assignment, you will use object-oriented programming techniques to model a basic University system 1. You will need to model the following classes: Address, Person, Student, Staff and Faculty. You may also model other classes as needed. 2. Provide three interfaces: Employee (with a salary0 method), and child interfaces (with Instructor(with a creditsTaught0 method) and Administrator position0 method). You may also provide other interfaces as needed. a 3. You will need to capture the following data members: first name, middle name, last name, date of birth, gender, address first line, city of address, state of address, zipcode of address, current semester enrolled in, number of credits completed, graduation status, PhD status for graduate students, number of credits currently enrolled in, department of employment, major and salary. Decide carefully where each data member (there are 17 data members listed) should be stored. 4. You may provide additional data members as needed. 5. Accessors should be provided for all data members 6. No mutators should be provided for any data member. The only way to modify data members from any class outside this hierarchy is to use the constructors (directly) or the methods below (indirectly). 7. Your implementation should include abstract classes, "concrete" classes, interfaces, inheritance and polymorphism

Explanation / Answer

Answer from 1 to 8 c:

import java.util.ArrayList;

import java.util.Date;

interface EmployeeInterface

{  

double getSalary();  

interface InstructorInterface

{

int creditsTaught();

}

interface Administrator

{

int position();

}

}

public class Address

{

private String AddressLine;

private String City;

private String State;

private String zipcode;

  

public Address()

{

  

}

public Address(String _AddressLine,String _city,String _state,String _zipCode)

{

this.AddressLine = _AddressLine;

this.City = _city;

this.State=_state;

this.zipcode = _zipCode;

}

public String getAddressLine()

{

return AddressLine;

}

  

public void setAddressLine(String _addressline)

{

this.AddressLine = _addressline;

}

  

public String getCity()

{

return this.City;

}

  

public void setCity(String _city)

{

this.City = _city;

}

  

public String getState()

{

return this.State;

}

  

public void setState(String _state)

{

this.State = _state;

}

public String getZipcode()

{

return this.zipcode;

}

  

public void setZipCode(String _zipCode)

{

this.zipcode = _zipCode;

}

  

public String toString()

{

System.out.println("Address Details");

System.out.println(this.AddressLine);

System.out.println(this.State);

System.out.println(this.City);

System.out.println(this.zipcode);

}

}

public class Person extends Address

{

private String FirstName;

private String LastName;

private String MiddleName;

private String Gender;

private Date dob;

  

public Person()

{

  

}

public Person(String _FirstName,String _LastName,String _MiddleName,String _gender,Date _dob,String _AddressLine,String _city,String _state,String _zipCode)

{

super(_AddressLine,_city,_state,_zipCode);

this.FirstName=_FirstName;

this.LastName = _LastName;

this.MiddleName = _MiddleName;

this.Gender = _gender;

this.dob =_dob;

  

}

  

public String getFirstName()

{

return this.FirstName;

}

  

public void setFirstName(String _FirstName)

{

this.FirstName = _FirstName;

}

  

public String getLastName()

{

return this.LastName;

}

  

public void setLastName(String _LastName)

{

this.LastName = _LastName;

}

  

public String getMiddleName()

{

return this.MiddleName;

}

  

public void setMiddelName(String _MiddleName)

{

this.MiddleName = _MiddleName;

}

  

public Date getDob()

{

return this.dob;

}

  

public void setDob(Date _dob)

{

this.dob = _dob;

}

  

public String toString()

{

System.out.println("Personal Details");

System.out.println(this.FirstName);

System.out.println(this.LastName);

System.out.println(this.MiddleName);

System.out.println(this.dob);

System.out.println(this.Gender);

}

  

}

public class Student extends Person

{

private String CurSemester;

private int CreditEnrolled ;

private String GraduationStatus ;

private String PhdStatus ;

private int CreditCompleted ;

  

public Student()

{

  

}

public Student(String _CurSemester,int _CreditEnrolled,String _GraduationStatus,String _PhdStatus,int _CreditCompleted)

{

this.CurSemester = _CurSemester;

this.CreditEnrolled = _CreditEnrolled;

this.GraduationStatus = _GraduationStatus;

this.PhdStatus=_PhdStatus;

this.CreditCompleted=_CreditCompleted;

}

  

public String getCurSemester()

{

return this.CurSemester;

}

  

public void setCurSemester(String _CurSemester)

{

this.CurSemester = _CurSemester;

}

  

public int getCreditEnrolled()

{

return this.CreditEnrolled;

}

  

public void setCreditEnrolled(int _Credit)

{

this.CreditEnrolled = _Credit;

}

public String getGraduationStatus()

{

return this.GraduationStatus;

}

  

public void setGraduationStatus(String _GraduationStatus)

{

this.GraduationStatus = _GraduationStatus;

}

public String getPhdStatus()

{

return this.PhdStatus;

}

  

public void setPhdStatus(String _PhdStatus)

{

this.PhdStatus = _PhdStatus;

}

public int getCreditCompleted()

{

return this.CreditCompleted;

}

  

public void setCreditCompleted(int _Credit)

{

this.CreditCompleted = _Credit;

}

public String toString()

{

System.out.println("Academic Details");

System.out.println(this.CurSemester);

System.out.println(this.CreditEnrolled);

System.out.println(this.GraduationStatus);

System.out.println(this.PhdStatus);

System.out.println(this.CreditCompleted);

}

public String Status()

{

if(this.GraduationStatus=="undergraduate")

{

int _calCredit = this.CreditCompleted+this.CreditEnrolled;

if(_calCredit>90)

{

return "Senior";

}

else if(_calCredit>60)

{

return "Junior";

}

else if(_calCredit>30)

{

return "Sophomore";

}

else if(_calCredit>0)

{

return "Freshmen";

}

}

else if(this.GraduationStatus=="graduated")

{

  

return this.PhdStatus;

}

else

{

return "Special";

}

}

  

public boolean isFullTime()

{

if(this.GraduationStatus=="undergraduate" && this.CreditEnrolled>=12)

{

return true;

}

else if(this.GraduationStatus=="graduate" && this.CreditEnrolled>=6)

{

return true;

}

else if(this.PhdStatus=="Master")

{

return true;

}

else

{

return false;

}

}

  

}

public class Employee extends Person

{

private String Department;

private String Major ;

private double Salary ;

public Employee()

{

}

public Employee(String _Department,String _Major,double _Salary)

{

this.Department=_Department;

this.Major=_Major;

this.Salary = _Salary;

}

public String getDepartment()

{

return this.Department;

}

  

public void setDepartment(String _Department)

{

this.Department = _Department;

}

  

public String getMajor()

{

return this.Major;

}

  

public void setMajor(String _Major)

{

this.Major = _Major;

}

public double getSalary()

{

return this.Salary;

}

  

public void setSalary(double _Salary)

{

this.Salary = _Salary;

}

public String toString()

{

System.out.println("Employee Details");

System.out.println(this.Department);

System.out.println(this.Major);

System.out.println(this.Salary);

}

}

class test {

public static void main(String[] args) {

  

ArrayList<Student> StudentsList = new ArrayList<Student>();

ArrayList<Employee> EmployeeList = new ArrayList<Employee>();

Person Admin= new Person();

  

//add data in array list through add method

  

}

}