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
9731013
lab9
Commits
a573c127
Commit
a573c127
authored
May 12, 2019
by
amsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init account interface
parent
8ea25366
Pipeline
#585
failed with stages
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
8 deletions
+39
-8
AbstractEmployee.java
org/university/core/AbstractEmployee.java
+0
-2
Account.java
org/university/core/Account.java
+7
-0
GraduateStudent.java
org/university/core/GraduateStudent.java
+10
-1
Professor.java
org/university/core/Professor.java
+11
-2
ServiceEmaployee.java
org/university/core/ServiceEmaployee.java
+9
-1
Statement.java
org/university/core/Statement.java
+2
-2
No files found.
org/university/core/AbstractEmployee.java
View file @
a573c127
...
@@ -43,7 +43,5 @@ public abstract class AbstractEmployee extends Person{
...
@@ -43,7 +43,5 @@ public abstract class AbstractEmployee extends Person{
return
false
;
return
false
;
}
}
abstract
public
double
getCurrentIncome
();
abstract
public
boolean
isPromotable
();
abstract
public
boolean
isPromotable
();
}
}
org/university/core/Account.java
View file @
a573c127
package
org
.
university
.
core
;
public
interface
Account
{
public
int
balance
;
public
int
getCurrentIncome
();
public
void
checkout
();
}
org/university/core/GraduateStudent.java
View file @
a573c127
...
@@ -2,8 +2,9 @@ package org.university.core;
...
@@ -2,8 +2,9 @@ package org.university.core;
import
java.util.*
;
import
java.util.*
;
public
class
GraduateStudent
extends
Student
{
public
class
GraduateStudent
extends
Student
implements
Account
{
private
ArrayList
<
Article
>
articles
;
private
ArrayList
<
Article
>
articles
;
private
ArrayList
<
Statement
>
;
public
GraduateStudent
(
String
name
,
int
entranceYear
,
int
id
){
public
GraduateStudent
(
String
name
,
int
entranceYear
,
int
id
){
super
(
name
,
entranceYear
,
id
);
super
(
name
,
entranceYear
,
id
);
...
@@ -16,6 +17,14 @@ public class GraduateStudent extends Student{
...
@@ -16,6 +17,14 @@ public class GraduateStudent extends Student{
return
arr
;
return
arr
;
}
}
public
Statement
checkout
(){
int
amount
=
getCurrentIncome
();
balance
+=
amount
;
Statement
statement
=
new
Statement
(
amount
,
new
Date
(),
(
Account
)
this
);
addBankStatement
(
statement
);
return
statement
;
}
public
void
addArticle
(
Article
c
){
public
void
addArticle
(
Article
c
){
articles
.
add
(
c
);
articles
.
add
(
c
);
}
}
...
...
org/university/core/Professor.java
View file @
a573c127
...
@@ -2,7 +2,7 @@ package org.university.core;
...
@@ -2,7 +2,7 @@ package org.university.core;
import
java.util.*
;
import
java.util.*
;
public
class
Professor
extends
AbstractEmployee
{
public
class
Professor
extends
AbstractEmployee
implements
Account
{
private
ArrayList
<
Course
>
courses
;
private
ArrayList
<
Course
>
courses
;
private
String
group
;
private
String
group
;
...
@@ -10,9 +10,18 @@ public class Professor extends AbstractEmployee{
...
@@ -10,9 +10,18 @@ public class Professor extends AbstractEmployee{
super
(
name
,
entranceYear
,
id
);
super
(
name
,
entranceYear
,
id
);
courses
=
new
ArrayList
<>();
courses
=
new
ArrayList
<>();
basicIncome
=
7000
;
basicIncome
=
7000
;
balance
=
0
;
}
}
public
double
getCurrentIncome
(){
public
Statement
checkout
(){
int
amount
=
getCurrentIncome
();
balance
+=
amount
;
Statement
statement
=
new
Statement
(
amount
,
new
Date
(),
(
Account
)
this
);
addBankStatement
(
statement
);
return
statement
;
}
public
int
getCurrentIncome
(){
return
courses
.
size
()
*
1000
+
basicIncome
;
return
courses
.
size
()
*
1000
+
basicIncome
;
}
}
...
...
org/university/core/ServiceEmaployee.java
View file @
a573c127
...
@@ -2,7 +2,7 @@ package org.university.core;
...
@@ -2,7 +2,7 @@ package org.university.core;
import
java.util.*
;
import
java.util.*
;
public
class
ServiceEmaployee
extends
AbstractEmployee
{
public
class
ServiceEmaployee
extends
AbstractEmployee
implements
Account
{
public
int
extraWork
;
public
int
extraWork
;
public
ServiceEmaployee
(
String
name
,
int
entranceYear
,
int
id
){
public
ServiceEmaployee
(
String
name
,
int
entranceYear
,
int
id
){
...
@@ -18,6 +18,14 @@ public class ServiceEmaployee extends AbstractEmployee{
...
@@ -18,6 +18,14 @@ public class ServiceEmaployee extends AbstractEmployee{
return
extraWork
;
return
extraWork
;
}
}
public
Statement
checkout
(){
int
amount
=
getCurrentIncome
();
balance
+=
amount
;
Statement
statement
=
new
Statement
(
amount
,
new
Date
(),
(
Account
)
this
);
addBankStatement
(
statement
);
return
statement
;
}
public
double
getCurrentIncome
(){
public
double
getCurrentIncome
(){
return
extraWork
*
500
+
basicIncome
;
return
extraWork
*
500
+
basicIncome
;
}
}
...
...
org/university/core/Statement.java
View file @
a573c127
...
@@ -5,9 +5,9 @@ import java.util.*;
...
@@ -5,9 +5,9 @@ import java.util.*;
public
class
Statement
{
public
class
Statement
{
private
int
amount
;
private
int
amount
;
private
Date
date
;
private
Date
date
;
private
A
bstractEmployee
receiver
;
private
A
ccount
receiver
;
public
Statement
(
int
amount
,
Date
date
,
A
bstractEmployee
receiver
){
public
Statement
(
int
amount
,
Date
date
,
A
ccount
receiver
){
this
.
amount
=
amount
;
this
.
amount
=
amount
;
this
.
date
=
date
;
this
.
date
=
date
;
this
.
receiver
=
receiver
;
this
.
receiver
=
receiver
;
...
...
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