Professional Documents
Culture Documents
Wah Campus
Submitted by:
public class Abcd { public class public class Employee public class Manager {
Student { { private String title;
private String private String private Student stdRecord[];
public static void degree; EmployeeId; private Employee empRecord;
main(String[] args) { private int year; private int salary;
//Student s1=new public Manager(String title) {
Student("BCS",2018); public Student() public Employee() { this.title = title;
Employee e1=new { } }
Employee("FA21- }
001",95000); public public void setTitle(String title) {
Manager m1=new Employee(String this.title = title;
Manager("General public EmployeeId, int }
Manager"); Student(String salary) {
Student degree, int year) { this.EmployeeId public void setStdRecord(Student[]
stdRecord[]=new Student[3]; this.degree = = EmployeeId; stdRecord) {
degree; this.salary = this.stdRecord = stdRecord;
for (int i = 0; i < 3; i++) this.year = salary; }
{ year; }
stdRecord[i]=new }
Student("BCS",2018); public void setEmpRecord(Employee
public void empRecord) {
}
public void setEmployeeId(String this.empRecord = empRecord;
setDegree(String EmployeeId) { }
m1.setStdRecord(stdRecord)
degree) { this.EmployeeId
;
this.degree = = EmployeeId;
m1.setEmpRecord(e1);
degree; }
m1.display();
}
public String getTitle() {
} public void
return title;
public void setSalary(int salary) {
}
} setYear(int year) { this.salary =
this.year = salary;
year; } public Student[] getStdRecord() {
} return stdRecord;
}
public String
public String getEmployeeId() {
getDegree() { return public Employee getEmpRecord() {
return degree; EmployeeId; return empRecord;
} } }
System.out.println(stdRecord[i].getDegree());
} }
System.out.println(stdRecord[i].getYear());
}
System.out.println("Employee Record:
"+"\nEmployee ID:
"+empRecord.getEmployeeId()+"\nSalary:
"+empRecord.getSalary());
}
}
Task 1 (a)
AssociationRunner StudentRecord EmployeeRecord Manager
}
Task 2
Activity2 Employee Date
this.year+=this.month/12;
this.month=this.month%12;
}
if(this.month==0){
this.month=12;
}
System.out.println(day+"/"+month+"/"+ye
ar);
}