Commit 54f71a19 authored by 9731044's avatar 9731044

Initial commit

parents
Pipeline #589 failed with stages
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>LAB-9</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
package org.university.core;
import java.util.ArrayList;
public abstract class AbstractEmployee extends Person{
ArrayList<Statement> bankStatements;
String position;
double basicIncome , currentIncome;
public AbstractEmployee(String firstName, String lastName, String position , String ID ,double basicIncome , int joiningYear , Department department) {
super(firstName,lastName,ID,joiningYear,department);
this.position = position;
this.basicIncome = basicIncome;
bankStatements = new ArrayList<>();
}
public String getPosition() {
return position;
}
public void addBankStatement(Statement s) {
bankStatements.add(s);
}
public ArrayList getBankStatement() {
return bankStatements;
}
public void setCurrentIncome(double currentIncome){
this.currentIncome = currentIncome;
}
public abstract double calCurrentIncome();
}
package org.university.core;
public class Account {
private AbstractEmployee owner;
double credit;
public Account(AbstractEmployee owner , double credit) {
this.credit = credit;
this.owner = owner;
this.credit=0;
}
public AbstractEmployee getOwner() {
return owner;
}
public double getCredit() {
return credit;
}
public void setCredit(double credit) {
this.credit = credit;
}
}
package org.university.core;
public class AccountingManagement {
}
package org.university.core;
public class Article {
}
package org.university.core;
import java.util.ArrayList;
public class Course {
private String name;
private Professor instructor;
private ArrayList<Student> students = new ArrayList<Student>();
private GraduateStudent teacherAssistance;
public GraduateStudent getTeacherAssistance() {
return teacherAssistance;
}
public void setTeacherAssistance(GraduateStudent teacherAssistance) {
this.teacherAssistance = teacherAssistance;
}
public Course(String name, Professor instructor) {
this.name = name;
this.instructor = instructor;
}
public String getName() {
return name;
}
public Professor getInstructor() {
return instructor;
}
public ArrayList<Student> getStudents() {
return students;
}
public void addStudent(Student student){
this.students.add(student);
}
}
import java.util.ArrayList;
public class Department {
private String name;
private ArrayList<Course> courses = new ArrayList<>();
public Department(String name){
this.name = name;
}
public String getName() {
return name;
}
public ArrayList<Course> getCourses() {
return courses;
}
public void addCourse(Course course){
courses.add(course);
}
}
package org.university.core;
public class GraduateStudent {
}
package org.university.core;
public class Person {
String firstName;
String lastName;
String ID;
int joiningYear;
Department department;
public Person (String firstName, String lastName, String ID, int joiningYear, Department department) {
this.department = department;
this.firstName = firstName;
this.ID = ID;
this.lastName = lastName;
}
public String getFullname() {
return firstName + lastName;
}
public String getID() {
return ID;
}
public int getJoiningYear() {
return joiningYear;
}
public Department getDepartment() {
return department;
}
}
package org.university.core;
import java.util.ArrayList;
public class Professor extends AbstractEmployee {
ArrayList<Course> courses;
String group;
ArrayList<Article> articles;
public Professor(String firstName, String lastName, String position, String ID, double basicIncome, int joiningYear,Department department, String group) {
super(firstName, lastName, position, ID, basicIncome, joiningYear, department);
this.group = group;
courses = new ArrayList<>();
articles = new ArrayList<>();
}
public void setPosition(String position) {
this.position = position;
}
public void setGroup(String group) {
this.group=group;
}
public void setBasicIncome(double basicIncome) {
this.basicIncome = basicIncome;
}
public void addCourse(Course c) {
courses.add(c);
}
public ArrayList<Course> getCourses(){
return courses;
}
public String getGroup() {
return group;
}
public void addArticle(Article a) {
articles.add(a);
}
@Override
public double calCurrentIncome() {
currentIncome+=articles.size()*1000;
return currentIncome;
}
}
package org.university.core;
public class ServiceEmployee extends AbstractEmployee {
public ServiceEmployee(String firstName, String lastName, String position, String ID, double basicIncome,int joiningYear, Department department) {
super(firstName, lastName, position, ID, basicIncome, joiningYear, department);
}
@Override
public double calCurrentIncome() {
return currentIncome;
}
}
package org.university.core;
public class Statement {
}
package org.university.core;
import java.util.ArrayList;
public class Student extends Person {
ArrayList<Course> courses;
public Student(String firstName, String lastName, String ID, int joiningYear, Department department) {
super(firstName, lastName, ID, joiningYear, department);
courses = new ArrayList<>();
}
public void addCourse(Course c) {
courses.add(c);
}
public ArrayList<Course> getCourses(){
return courses;
}
}
package org.university.core;
public class Undergrad extends Student {
public Undergrad(String firstName, String lastName, String ID, int joiningYear, Department department) {
super(firstName, lastName, ID, joiningYear, department);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment