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
mrsl2000
lab9
Commits
c09a7d39
Commit
c09a7d39
authored
May 16, 2019
by
mrsl2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tammom shod lab9 lanati
parents
Pipeline
#703
canceled with stages
Changes
12
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
331 additions
and
0 deletions
+331
-0
AbstractEmployee.java
org/university/core/AbstractEmployee.java
+57
-0
Account.java
org/university/core/Account.java
+23
-0
AccountingInterface.java
org/university/core/AccountingInterface.java
+10
-0
AccountingManagement.java
org/university/core/AccountingManagement.java
+36
-0
Bill.java
org/university/core/Bill.java
+27
-0
Course.java
org/university/core/Course.java
+32
-0
Department.java
org/university/core/Department.java
+26
-0
Person.java
org/university/core/Person.java
+42
-0
Professor.java
org/university/core/Professor.java
+29
-0
Publication.java
org/university/core/Publication.java
+20
-0
ServiceEmployee.java
org/university/core/ServiceEmployee.java
+11
-0
Student.java
org/university/core/Student.java
+18
-0
No files found.
org/university/core/AbstractEmployee.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
abstract
class
AbstractEmployee
extends
Person
implements
AccountingInterface
{
protected
String
position
;
protected
double
basicIncome
,
currentIncome
;
protected
ArrayList
<
Bill
>
bankBill
=
new
ArrayList
<
Bill
>();
public
AbstractEmployee
(
String
firstName
,
String
lastName
,
int
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
(
Bill
s
)
{
bankBill
.
add
(
s
);
}
@Override
public
AbstractEmployee
getEmployee
()
{
return
this
;
}
@Override
public
double
getCurrentIncome
()
{
return
currentIncome
;
}
public
ArrayList
<
Bill
>
getBankBill
()
{
return
bankBill
;
}
public
String
getPosition
()
{
return
position
;
}
public
double
getBasicIncome
()
{
return
basicIncome
;
}
public
void
setCurrentIncome
(
double
currentIncome
)
{
this
.
currentIncome
=
currentIncome
;
}
}
org/university/core/Account.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
public
class
Account
{
private
AbstractEmployee
owner
;
private
double
money
;
public
Account
(
AbstractEmployee
owner
,
double
money
){
this
.
money
=
money
;
this
.
owner
=
owner
;
}
public
AbstractEmployee
getOwner
()
{
return
owner
;
}
public
double
getMoney
()
{
return
money
;
}
public
void
setMoney
(
double
money
)
{
this
.
money
=
money
;
}
}
org/university/core/AccountingInterface.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
public
interface
AccountingInterface
{
double
getCurrentIncome
();
AbstractEmployee
getEmployee
();
}
org/university/core/AccountingManagement.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
AccountingManagement
{
private
ArrayList
<
Bill
>
Bills
;
private
ArrayList
<
Account
>
accounts
;
public
void
check
(
AccountingInterface
employee
)
{
int
f
=
1
;
for
(
Account
account:
accounts
)
{
if
(
account
.
getOwner
()
==
employee
)
{
double
amount
=
employee
.
getCurrentIncome
();
account
.
setMoney
(
account
.
getMoney
()+
amount
);
f
=
0
;
Bill
s
=
new
Bill
(
amount
,
employee
.
getEmployee
());
Bills
.
add
(
s
);
}
}
if
(
f
>
1
)
{
double
amount
=
employee
.
getCurrentIncome
();
Account
ac
=
new
Account
(
employee
.
getEmployee
(),
employee
.
getCurrentIncome
());
accounts
.
add
(
ac
);
Bill
s
=
new
Bill
(
amount
,
employee
.
getEmployee
());
Bills
.
add
(
s
);
}
}
}
org/university/core/Bill.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
public
class
Bill
{
private
double
amount
;
private
AbstractEmployee
receiver
;
public
Bill
(
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
receiver
)
{
this
.
receiver
=
receiver
;
}
}
org/university/core/Course.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
Course
{
private
String
name
;
private
Professor
instructor
;
private
ArrayList
<
Student
>
students
=
new
ArrayList
<
Student
>();
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
);
}
}
org/university/core/Department.java
0 → 100644
View file @
c09a7d39
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
);
}
}
\ No newline at end of file
org/university/core/Person.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
public
class
Person
{
protected
String
firstName
;
protected
String
lastName
;
protected
int
ID
;
protected
int
joiningYear
;
protected
Department
department
;
public
Person
(
String
firstName
,
String
lastName
,
int
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
String
getLastName
()
{
return
lastName
;
}
public
int
getID
()
{
return
ID
;
}
public
int
getJoiningYear
()
{
return
joiningYear
;
}
public
Department
getDepartment
()
{
return
department
;
}
public
void
setDepartment
(
Department
department
)
{
this
.
department
=
department
;
}
}
org/university/core/Professor.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
Professor
extends
AbstractEmployee
{
ArrayList
<
Course
>
courses
=
new
ArrayList
<>();
String
group
;
public
Professor
(
String
firstName
,
String
lastName
,
int
ID
,
int
joiningYear
,
Department
department
,
String
position
,
double
basicIncome
,
String
group
){
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
,
position
,
basicIncome
);
this
.
group
=
group
;
}
public
Course
[]
getCourses
()
{
Course
[]
temp
=
new
Course
[
courses
.
size
()];
courses
.
toArray
(
temp
);
return
temp
;
}
public
void
addCourse
(
Course
c
){
this
.
courses
.
add
(
c
);
}
public
String
getGroup
()
{
return
group
;
}
@Override
public
boolean
isPromotable
(){
return
false
;
}
}
org/university/core/Publication.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
public
class
Publication
{
private
String
title
;
private
int
year
;
public
Publication
(
String
title
,
int
year
){
this
.
title
=
title
;
this
.
year
=
year
;
}
public
int
getYear
()
{
return
year
;
}
public
String
getTitle
()
{
return
title
;
}
}
org/university/core/ServiceEmployee.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
public
class
ServiceEmployee
extends
AbstractEmployee
{
public
ServiceEmployee
(
String
firstName
,
String
lastName
,
int
ID
,
int
joiningYear
,
Department
department
,
String
position
,
double
basicIncome
){
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
,
position
,
basicIncome
);
}
@Override
public
boolean
isPromotable
(){
return
false
;
}
}
org/university/core/Student.java
0 → 100644
View file @
c09a7d39
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
Student
extends
Person
{
ArrayList
<
Course
>
courses
=
new
ArrayList
<>();
public
Student
(
String
firstName
,
String
lastName
,
int
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
;
}
}
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