Commit fef3e88c authored by armin's avatar armin

final

parent e416a740
......@@ -21,16 +21,16 @@ public abstract class AbstractEmployee extends Person implements AccountingInter
public abstract double callCurrentIncome() ;
public void addBankStatement(Statement s)
{
bankStatments.add(s);
}
@Override
public AbstractEmployee callEmployee() {
return this;
}
public void addBankStatement(Statement s)
{
bankStatments.add(s);
}
public ArrayList<Statement> getBankStatments() {
return bankStatments;
}
......
package org.university.core;
package org.university.core ;
public class Account
{
private AbstractEmployee owner;
private double credit;
private AbstractEmployee owner ;
private double credit = 0 ;
private double demand = 0 ;
public Account(AbstractEmployee owner, double credit) {
this.owner = owner;
this.credit = credit;
this.owner = owner ;
this.credit = credit ;
this.demand = 0 ;
}
public AbstractEmployee getOwner() {
......@@ -25,4 +27,12 @@ public class Account
public void setCredit(double credit) {
this.credit = credit;
}
public double getDemand() {
return demand;
}
public void setDemand(double demand) {
this.demand = demand;
}
}
\ No newline at end of file
......@@ -12,10 +12,10 @@ public class AccountingManagement
boolean flag = true;
for (Account account:accounts)
{
if (account.getOwner()==employee)
if (account.getOwner() == employee)
{
double amount = employee.callCurrentIncome();
account.setCredit(account.getCredit()+amount);
account.setCredit(account.getCredit() + amount);
flag = false;
Statement s = new Statement(amount,employee.callEmployee());
statements.add(s);
......@@ -31,4 +31,15 @@ public class AccountingManagement
}
}
public void settle(AccountingInterface employee){
for(Account account:accounts){
if(account.getOwner() == employee){
if(account.getDemand() > 0){
account.setCredit(account.getCredit() + account.getDemand());
account.setDemand(0);
}
}
}
}
}
......@@ -6,14 +6,14 @@ public class Course {
private String name;
private Professor instructor;
private ArrayList<Student> students = new ArrayList<Student>();
private GradStudent teacherAssistance;
private Master teacherAssistance;
public GradStudent getTeacherAssistance() {
public Master getTeacherAssistance() {
return teacherAssistance;
}
public void setTeacherAssistance(GradStudent teacherAssistance) {
public void setTeacherAssistance(Master teacherAssistance) {
this.teacherAssistance = teacherAssistance;
}
......
......@@ -4,7 +4,7 @@ import java.util.ArrayList;
public class Master extends Student
{
private ArrayList<Article> publications;
private ArrayList<Article> articles;
private Professor advisor;
public Master(String firstName, String lastName, String ID, int joiningYear, Department department, Professor advisor) {
......@@ -14,15 +14,15 @@ public class Master extends Student
public void addArticle(Article p)
{
publications.add(p);
articles.add(p);
}
public ArrayList<Article> getArticle() {
return publications;
return articles ;
}
public Professor getAdvisor() {
return advisor;
return advisor ;
}
......
......@@ -48,4 +48,9 @@ public class Professor extends AbstractEmployee {
public double callCurrentIncome() {
return getIncome() ;
}
@Override
public AbstractEmployee callEmployee() {
return null;
}
}
......@@ -17,7 +17,7 @@ public class ServiceEmployee extends AbstractEmployee
}
public void income(ServiceEmployee serviceEmployee){
income = ( additionalHour*500) + basicIncome;
income = ( additionalHour*500 ) + basicIncome;
}
public double getIncome(){
......
  • با سلام و عرض خسته نباشید استاد اون نموداری که در جلسه هشتم کشیدیم رو چون من فقط به صورت پی دی اف دانلود کرده بودم و لینکشو نداشتم و در جلسه نهم باید یه تغییرات ریزی در نمودار که مربوط به کد این جلسه بود ، میدادیم رو نتونستم نمودار رو تغییر بدم و سر کلاس به شما گفتم و شما گفتید عیب نداره فقط تو این جا یه توضیحی بدم که دادم و اینکه تغییر نمودار فقط مربوط به 2،3 تا متد در یه کلاس بود همین ممنون

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