Commit 6946658a authored by 9731050's avatar 9731050

4th

parent 5eb98ae1
Pipeline #592 failed with stages
package org.university.core;
public class Account
{
private AbstractEmployee owner;
private double credit;
public Account(AbstractEmployee owner, double credit) {
this.owner = owner;
this.credit = credit;
}
public AbstractEmployee getOwner() {
return owner;
}
public void setOwner(AbstractEmployee owner) {
this.owner = owner;
}
public double getCredit() {
return credit;
}
public void setCredit(double credit) {
this.credit = credit;
}
}
\ No newline at end of file
package org.university.core;
import java.util.ArrayList;
public class AccountingManagement {
private ArrayList<Account> accounts;
private ArrayList<Statement> statements;
public void checkout(AccountingInterface employee)
{
boolean command = true;
for (Account account:accounts)
{
if (account.getOwner()==employee)
{
double amount = employee.callCurrentIncome();
account.setCredit(account.getCredit()+amount);
command = false;
Statement s = new Statement(amount,employee.callEmployee());
statements.add(s);
}
}
if (command)
{
double amount = employee.callCurrentIncome();
Account ac = new Account(employee.callEmployee(),employee.callCurrentIncome());
accounts.add(ac);
Statement s = new Statement(amount,employee.callEmployee());
statements.add(s);
}
}
}
...@@ -3,18 +3,20 @@ package org.university.core; ...@@ -3,18 +3,20 @@ package org.university.core;
import java.util.ArrayList; import java.util.ArrayList;
public class GradStudent extends Student{ public class GradStudent extends Student{
private ArrayList<publication>publications; private ArrayList<Publication>publications;
private Professor advisor; private Professor advisor;
public GradStudent(String firstName, String lastName, String ID, int joiningYear, Department department,Professor professor) { public GradStudent(String firstName, String lastName, String ID, int joiningYear, Department department,Professor professor) {
super(firstName, lastName, ID, joiningYear, department); super(firstName, lastName, ID, joiningYear, department);
publications=new ArrayList<publication>(); publications=new ArrayList<Publication>();
this.advisor=professor; this.advisor=professor;
} }
public void addPublication(Publication p){ public void addPublication(Publication p){
publications.add(p); publications.add(p);
} }
public ArrayList<publication> getPublications() { public ArrayList<Publication> getPublications() {
return publications; return publications;
} }
// public int calCurrentIncome(){}
} }
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