Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
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
9731082
Lab9
Commits
3b278a1a
Commit
3b278a1a
authored
May 12, 2019
by
armin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code avalie sare kaargah
parent
daf375c0
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
472 additions
and
0 deletions
+472
-0
AbstractEmployee.java
src/org/university/core/AbstractEmployee.java
+63
-0
Account.java
src/org/university/core/Account.java
+28
-0
AccountingInterface.java
src/org/university/core/AccountingInterface.java
+6
-0
AccountingManagement.java
src/org/university/core/AccountingManagement.java
+34
-0
Article.java
src/org/university/core/Article.java
+20
-0
Bachler.java
src/org/university/core/Bachler.java
+20
-0
Course.java
src/org/university/core/Course.java
+40
-0
Department.java
src/org/university/core/Department.java
+23
-0
Master.java
src/org/university/core/Master.java
+29
-0
Person.java
src/org/university/core/Person.java
+58
-0
Professor.java
src/org/university/core/Professor.java
+50
-0
ServiceEmployee.java
src/org/university/core/ServiceEmployee.java
+36
-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
No files found.
src/org/university/core/AbstractEmployee.java
0 → 100644
View file @
3b278a1a
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
;
protected
double
currentIncome
;
int
pastDays
;
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
AbstractEmployee
callEmployee
()
{
return
this
;
}
public
abstract
double
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 @
3b278a1a
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/AccountingInterface.java
0 → 100644
View file @
3b278a1a
package
org
.
university
.
core
;
public
interface
AccountingInterface
{
public
AbstractEmployee
callEmployee
();
public
double
callCurrentIncome
();
}
src/org/university/core/AccountingManagement.java
0 → 100644
View file @
3b278a1a
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 @
3b278a1a
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/Bachler.java
0 → 100644
View file @
3b278a1a
package
org
.
university
.
core
;
public
class
Bachler
extends
Student
{
private
Type
field
;
public
Bachler
(
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
;
}
}
src/org/university/core/Course.java
0 → 100644
View file @
3b278a1a
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 @
3b278a1a
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/Master.java
0 → 100644
View file @
3b278a1a
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
Master
extends
Student
{
private
ArrayList
<
Article
>
publications
;
private
Professor
advisor
;
public
Master
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
Professor
advisor
)
{
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
);
this
.
advisor
=
advisor
;
}
public
void
addArticle
(
Article
p
)
{
publications
.
add
(
p
);
}
public
ArrayList
<
Article
>
getArticle
()
{
return
publications
;
}
public
Professor
getAdvisor
()
{
return
advisor
;
}
}
src/org/university/core/Person.java
0 → 100644
View file @
3b278a1a
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 @
3b278a1a
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
Professor
extends
AbstractEmployee
{
private
ArrayList
<
Course
>
courses
;
private
ArrayList
<
Article
>
articles
;
private
String
group
;
private
double
income
=
0
;
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
article
){
articles
.
add
(
article
)
;
}
public
ArrayList
getArticles
(){
return
articles
;
}
public
void
income
(
Professor
p
){
income
=
(
p
.
articles
.
size
())*
1000
+
basicIncome
;
}
public
void
setIncome
(
double
income
){
this
.
income
=
income
;
}
public
double
getIncome
()
{
return
income
;
}
@Override
public
boolean
isPromotable
()
{
if
(
articles
.
size
()
>
10
)
return
true
;
else
return
false
;
}
@Override
public
double
callCurrentIncome
()
{
return
0
;
}
}
src/org/university/core/ServiceEmployee.java
0 → 100644
View file @
3b278a1a
package
org
.
university
.
core
;
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
;
double
income
;
public
void
setPassedDays
(
int
passedDays
){
this
.
passedDays
++
;
}
public
void
income
(
ServiceEmployee
s
){
income
=
}
@Override
public
boolean
isPromotable
()
{
if
(
passedDays
>
(
365
*
3
)){
passedDays
=
0
;
return
true
;
}
else
return
false
;
}
@Override
public
double
callCurrentIncome
()
{
return
0
;
}
}
src/org/university/core/Statement.java
0 → 100644
View file @
3b278a1a
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 @
3b278a1a
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 @
3b278a1a
package
org
.
university
.
core
;
public
class
Type
{
private
String
type
;
public
Type
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getType
()
{
return
type
;
}
}
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