Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
project-Lab9
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amirhosein Rajabpour
project-Lab9
Commits
5f84f1ae
Commit
5f84f1ae
authored
May 12, 2019
by
Amirhosein Rajabpour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first commit
parent
ff502181
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
438 additions
and
0 deletions
+438
-0
AbstractEmployee.java
src/org/university/core/AbstractEmployee.java
+59
-0
Account.java
src/org/university/core/Account.java
+28
-0
AccountingManagement.java
src/org/university/core/AccountingManagement.java
+34
-0
Article.java
src/org/university/core/Article.java
+20
-0
Course.java
src/org/university/core/Course.java
+40
-0
Department.java
src/org/university/core/Department.java
+23
-0
GradStudent.java
src/org/university/core/GradStudent.java
+29
-0
Person.java
src/org/university/core/Person.java
+58
-0
Professor.java
src/org/university/core/Professor.java
+33
-0
ServiceEmployee.java
src/org/university/core/ServiceEmployee.java
+29
-0
Statement.java
src/org/university/core/Statement.java
+27
-0
Student.java
src/org/university/core/Student.java
+23
-0
Type.java
src/org/university/core/Type.java
+15
-0
UnderGradStudent.java
src/org/university/core/UnderGradStudent.java
+20
-0
No files found.
src/org/university/core/AbstractEmployee.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
abstract
class
AbstractEmployee
extends
Person
implements
AccountingInterface
{
protected
ArrayList
<
Statement
>
bankStatments
=
new
ArrayList
<
Statement
>();
protected
String
position
;
protected
double
basicIncome
,
currentIncome
;
public
AbstractEmployee
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
String
position
,
double
basicIncome
)
{
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
);
this
.
position
=
position
;
this
.
basicIncome
=
basicIncome
;
}
public
abstract
boolean
isPromotable
();
public
void
addBankStatement
(
Statement
s
)
{
bankStatments
.
add
(
s
);
}
@Override
public
double
callCurrentIncome
()
{
return
callCurrentIncome
();
}
public
ArrayList
<
Statement
>
getBankStatments
()
{
return
bankStatments
;
}
public
String
getPosition
()
{
return
position
;
}
public
void
setPosition
(
String
position
)
{
this
.
position
=
position
;
}
public
double
getBasicIncome
()
{
return
basicIncome
;
}
public
void
setBasicIncome
(
double
basicIncome
)
{
this
.
basicIncome
=
basicIncome
;
}
public
void
setCurrentIncome
(
double
currentIncome
)
{
this
.
currentIncome
=
currentIncome
;
}
public
double
calCurrentIncome
()
{
return
currentIncome
;
}
}
src/org/university/core/Account.java
0 → 100644
View file @
5f84f1ae
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
src/org/university/core/AccountingManagement.java
0 → 100644
View file @
5f84f1ae
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
flag
=
true
;
for
(
Account
account:
accounts
)
{
if
(
account
.
getOwner
()==
employee
)
{
double
amount
=
employee
.
callCurrentIncome
();
account
.
setCredit
(
account
.
getCredit
()+
amount
);
flag
=
false
;
Statement
s
=
new
Statement
(
amount
,
employee
.
callEmployee
());
statements
.
add
(
s
);
}
}
if
(
flag
)
{
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
);
}
}
}
src/org/university/core/Article.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
public
class
Article
{
private
String
title
;
private
int
year
;
public
Article
(
String
title
,
int
year
)
{
this
.
title
=
title
;
this
.
year
=
year
;
}
public
String
getTitle
()
{
return
title
;
}
public
int
getYear
()
{
return
year
;
}
}
src/org/university/core/Course.java
0 → 100644
View file @
5f84f1ae
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
GradStudent
teacherAssistance
;
public
GradStudent
getTeacherAssistance
()
{
return
teacherAssistance
;
}
public
void
setTeacherAssistance
(
GradStudent
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
);
}
}
src/org/university/core/Department.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
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
);
}
}
src/org/university/core/GradStudent.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
GradStudent
extends
Student
{
private
ArrayList
<
Publication
>
publications
;
private
Professor
advisor
;
public
GradStudent
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
Professor
advisor
)
{
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
);
this
.
advisor
=
advisor
;
}
public
void
addPublication
(
Publication
p
)
{
publications
.
add
(
p
);
}
public
ArrayList
<
Publication
>
getPublications
()
{
return
publications
;
}
public
Professor
getAdvisor
()
{
return
advisor
;
}
}
src/org/university/core/Person.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
public
class
Person
{
protected
String
firstName
;
protected
String
lastName
;
protected
String
ID
;
protected
int
joiningYear
;
protected
Department
department
;
public
Person
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
)
{
this
.
firstName
=
firstName
;
this
.
lastName
=
lastName
;
this
.
ID
=
ID
;
this
.
joiningYear
=
joiningYear
;
this
.
department
=
department
;
}
public
String
getFirstName
()
{
return
firstName
;
}
public
void
setFirstName
(
String
firstName
)
{
this
.
firstName
=
firstName
;
}
public
String
getLastName
()
{
return
lastName
;
}
public
void
setLastName
(
String
lastName
)
{
this
.
lastName
=
lastName
;
}
public
String
getID
()
{
return
ID
;
}
public
void
setID
(
String
ID
)
{
this
.
ID
=
ID
;
}
public
int
getJoiningYear
()
{
return
joiningYear
;
}
public
void
setJoiningYear
(
int
joiningYear
)
{
this
.
joiningYear
=
joiningYear
;
}
public
Department
getDepartment
()
{
return
department
;
}
public
void
setDepartment
(
Department
department
)
{
this
.
department
=
department
;
}
}
src/org/university/core/Professor.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
Professor
extends
AbstractEmployee
{
private
ArrayList
<
Course
>
courses
;
private
ArrayList
<
Article
>
articles
;
private
String
group
;
public
Professor
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
String
position
,
double
basicIncome
,
String
group
)
{
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
,
position
,
basicIncome
);
this
.
group
=
group
;
}
public
void
addArticle
(
Article
a
){
articles
.
add
(
a
);
}
public
ArrayList
getArticles
(){
return
articles
;
}
@Override
public
boolean
isPromotable
()
{
if
(
articles
.
size
()>
10
)
return
true
;
else
return
false
;
}
}
src/org/university/core/ServiceEmployee.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
import
java.util.Date
;
public
class
ServiceEmployee
extends
AbstractEmployee
{
public
ServiceEmployee
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
String
position
,
double
basicIncome
)
{
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
,
position
,
basicIncome
);
}
int
passedDays
=
0
;
public
void
setPassedDays
(
int
passedDays
)
{
this
.
passedDays
++;
}
@Override
public
boolean
isPromotable
()
{
if
(
passedDays
>
365
*
3
)
{
passedDays
=
0
;
return
true
;
}
else
return
false
;
}
}
src/org/university/core/Statement.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
public
class
Statement
{
private
double
amount
;
private
AbstractEmployee
receiver
;
public
Statement
(
double
amount
,
AbstractEmployee
receiver
)
{
this
.
amount
=
amount
;
this
.
receiver
=
receiver
;
}
public
double
getAmount
()
{
return
amount
;
}
public
void
setAmount
(
double
amount
)
{
this
.
amount
=
amount
;
}
public
AbstractEmployee
getReciever
()
{
return
receiver
;
}
public
void
setReciever
(
AbstractEmployee
reciver
)
{
this
.
receiver
=
receiver
;
}
}
src/org/university/core/Student.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
Student
extends
Person
{
private
ArrayList
<
Course
>
courses
;
public
Student
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
)
{
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
);
}
public
void
addCourse
(
Course
c
)
{
courses
.
add
(
c
);
}
public
ArrayList
<
Course
>
getCourses
()
{
return
courses
;
}
}
src/org/university/core/Type.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
public
class
Type
{
private
String
type
;
public
Type
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getType
()
{
return
type
;
}
}
src/org/university/core/UnderGradStudent.java
0 → 100644
View file @
5f84f1ae
package
org
.
university
.
core
;
public
class
UnderGradStudent
extends
Student
{
private
Type
field
;
public
UnderGradStudent
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
Type
field
)
{
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
);
this
.
field
=
field
;
}
public
void
setField
(
Type
field
)
{
this
.
field
=
field
;
}
public
Type
getField
()
{
return
field
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment