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
9731050
Lab9
Commits
7efa2917
Commit
7efa2917
authored
May 14, 2019
by
9731050
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5th
parent
6946658a
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
142 additions
and
60 deletions
+142
-60
Account.java
src/org/university/core/Account.java
+11
-3
AccountingManagement.java
src/org/university/core/AccountingManagement.java
+9
-8
Article.java
src/org/university/core/Article.java
+19
-0
Employee.java
src/org/university/core/Employee.java
+0
-32
GradStudent.java
src/org/university/core/GradStudent.java
+1
-1
Professor.java
src/org/university/core/Professor.java
+34
-12
ServiceEmployee.java
src/org/university/core/ServiceEmployee.java
+44
-2
Type.java
src/org/university/core/Type.java
+15
-0
UnderGradStudent.java
src/org/university/core/UnderGradStudent.java
+9
-2
No files found.
src/org/university/core/Account.java
View file @
7efa2917
package
org
.
university
.
core
;
package
org
.
university
.
core
;
public
class
Account
public
class
Account
{
{
private
AbstractEmployee
owner
;
private
AbstractEmployee
owner
;
private
double
credit
;
private
double
credit
;
private
double
demand
;
public
Account
(
AbstractEmployee
owner
,
double
credit
)
{
public
Account
(
AbstractEmployee
owner
,
double
credit
)
{
this
.
owner
=
owner
;
this
.
owner
=
owner
;
this
.
credit
=
credit
;
this
.
credit
=
credit
;
demand
=
0
;
}
}
public
AbstractEmployee
getOwner
()
{
public
AbstractEmployee
getOwner
()
{
...
@@ -25,4 +25,12 @@ public class Account
...
@@ -25,4 +25,12 @@ public class Account
public
void
setCredit
(
double
credit
)
{
public
void
setCredit
(
double
credit
)
{
this
.
credit
=
credit
;
this
.
credit
=
credit
;
}
}
public
double
getDemand
()
{
return
demand
;
}
public
void
setDemand
(
double
demand
)
{
this
.
demand
=
demand
;
}
}
}
\ No newline at end of file
src/org/university/core/AccountingManagement.java
View file @
7efa2917
...
@@ -5,22 +5,23 @@ import java.util.ArrayList;
...
@@ -5,22 +5,23 @@ import java.util.ArrayList;
public
class
AccountingManagement
{
public
class
AccountingManagement
{
private
ArrayList
<
Account
>
accounts
;
private
ArrayList
<
Account
>
accounts
;
private
ArrayList
<
Statement
>
statements
;
private
ArrayList
<
Statement
>
statements
;
public
void
checkout
(
AccountingInterface
employee
)
public
void
checkout
(
AccountingInterface
employee
)
{
{
boolean
command
=
true
;
boolean
command
=
true
;
for
(
Account
account:
accounts
)
for
(
Account
account:
accounts
)
{
{
if
(
account
.
getOwner
()==
employee
)
{
if
(
account
.
getOwner
()==
employee
)
{
double
amount
=
employee
.
callCurrentIncome
();
double
amount
=
employee
.
callCurrentIncome
();
account
.
setCredit
(
account
.
getCredit
()+
amount
);
account
.
setCredit
(
account
.
getCredit
()+
amount
);
command
=
false
;
command
=
false
;
Statement
s
=
new
Statement
(
amount
,
employee
.
callEmployee
());
Statement
s
=
new
Statement
(
amount
,
employee
.
callEmployee
());
statements
.
add
(
s
);
statements
.
add
(
s
);
if
(
account
.
getDemand
()
>
0
){
account
.
setCredit
(
account
.
getCredit
()
+
account
.
getDemand
());
account
.
setDemand
(
0
);
}
}
}
}
}
if
(
command
)
if
(
command
)
{
{
double
amount
=
employee
.
callCurrentIncome
();
double
amount
=
employee
.
callCurrentIncome
();
Account
ac
=
new
Account
(
employee
.
callEmployee
(),
employee
.
callCurrentIncome
());
Account
ac
=
new
Account
(
employee
.
callEmployee
(),
employee
.
callCurrentIncome
());
accounts
.
add
(
ac
);
accounts
.
add
(
ac
);
...
...
src/org/university/core/Article.java
0 → 100644
View file @
7efa2917
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/Employee.java
deleted
100644 → 0
View file @
6946658a
package
org
.
university
.
core
;
import
java.sql.Statement
;
import
java.util.ArrayList
;
public
class
Employee
extends
Person
{
protected
ArrayList
<
Statement
>
bankStatement
;
protected
String
position
;
protected
double
basicIncome
;
public
Employee
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
String
position
,
double
basicIncome
)
{
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
);
this
.
position
=
position
;
bankStatement
=
new
ArrayList
<
Statement
>();
this
.
basicIncome
=
basicIncome
;
}
public
ArrayList
<
Statement
>
getBankStatement
()
{
return
bankStatement
;
}
public
void
addBankstatement
(
Statement
statement
){
bankStatement
.
add
(
statement
);
}
public
String
getPosition
()
{
return
position
;
}
public
void
setBasicIncome
(
double
income
){
basicIncome
=
income
;
}
}
src/org/university/core/GradStudent.java
View file @
7efa2917
...
@@ -18,5 +18,5 @@ public class GradStudent extends Student{
...
@@ -18,5 +18,5 @@ public class GradStudent extends Student{
return
publications
;
return
publications
;
}
}
// public int calCurrentIncome(){}
}
}
src/org/university/core/Professor.java
View file @
7efa2917
...
@@ -2,27 +2,49 @@ package org.university.core;
...
@@ -2,27 +2,49 @@ package org.university.core;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
public
class
Professor
extends
Employee
{
public
class
Professor
extends
AbstractEmployee
{
private
ArrayList
<
Course
>
courses
;
private
double
income
=
0
;
private
ArrayList
<
Course
>
courses
;
private
ArrayList
<
Article
>
articles
;
private
String
group
;
private
String
group
;
public
Professor
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
String
position
,
double
basicIncome
,
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
);
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
,
position
,
basicIncome
);
courses
=
new
ArrayList
<>()
;
this
.
group
=
group
;
this
.
group
=
group
;
this
.
income
=
0
;
}
}
public
ArrayList
<
Course
>
getCourses
()
{
return
courses
;
public
void
income
(
Professor
professor
){
income
=
(
professor
.
articles
.
size
()*
1000
)
+
basicIncome
;
}
}
public
String
getGroup
(
)
{
public
void
setIncome
(
double
income
)
{
return
group
;
this
.
income
=
income
;
}
}
public
void
addCourse
(
Course
c
){
courses
.
add
(
c
);
public
double
getIncome
()
{
return
income
;
}
}
public
double
getCurrentIncome
(){
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
;
}
@Override
public
AbstractEmployee
callEmployee
()
{
return
null
;
}
}
}
src/org/university/core/ServiceEmployee.java
View file @
7efa2917
package
org
.
university
.
core
;
package
org
.
university
.
core
;
public
class
ServiceEmployee
extends
Employee
{
import
java.util.Date
;
public
class
ServiceEmployee
extends
AbstractEmployee
{
double
income
;
int
additionalHour
;
int
passedDays
;
public
ServiceEmployee
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
String
position
,
double
basicIncome
)
{
public
ServiceEmployee
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
String
position
,
double
basicIncome
)
{
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
,
position
,
basicIncome
);
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
,
position
,
basicIncome
);
this
.
income
=
0
;
income
=
0
;
additionalHour
=
0
;
passedDays
=
0
;
}
public
void
setPassedDays
(
int
passedDays
)
{
this
.
passedDays
++;
}
public
void
income
(
ServiceEmployee
serviceEmployee
){
income
=
(
additionalHour
*
500
)
+
basicIncome
;
}
public
double
getIncome
()
{
return
income
;
}
}
public
double
getCurrentIncome
(){
public
void
setIncome
(
double
income
)
{
this
.
income
=
income
;
}
}
public
void
setAdditionalHour
(
int
additionalHour
)
{
this
.
additionalHour
=
additionalHour
;
}
@Override
public
boolean
isPromotable
()
{
if
(
passedDays
>
365
*
3
){
passedDays
=
0
;
return
true
;
}
else
return
false
;
}
@Override
public
AbstractEmployee
callEmployee
()
{
return
null
;
}
}
}
src/org/university/core/Type.java
0 → 100644
View file @
7efa2917
package
org
.
university
.
core
;
public
class
Type
{
private
String
type
;
public
Type
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getType
()
{
return
type
;
}
}
\ No newline at end of file
src/org/university/core/UnderGradStudent.java
View file @
7efa2917
package
org
.
university
.
core
;
package
org
.
university
.
core
;
public
class
UnderGradStudent
extends
Student
{
public
class
UnderGradStudent
extends
Student
{
public
UnderGradStudent
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
)
{
private
Type
filed
;
public
UnderGradStudent
(
String
firstName
,
String
lastName
,
String
ID
,
int
joiningYear
,
Department
department
,
Type
filed
)
{
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
);
super
(
firstName
,
lastName
,
ID
,
joiningYear
,
department
);
this
.
filed
=
filed
;
}
public
void
setFiled
(
Type
filed
){
this
.
filed
=
filed
;
}
public
Type
getFiled
()
{
return
filed
;
}
}
}
}
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