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
109c0858
Commit
109c0858
authored
May 12, 2019
by
amsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first commit without compile error abstract compeleted
parents
Pipeline
#578
canceled with stages
Changes
13
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
309 additions
and
0 deletions
+309
-0
.DS_Store
org/.DS_Store
+0
-0
.DS_Store
org/university/.DS_Store
+0
-0
AbstractEmployee.java
org/university/core/AbstractEmployee.java
+49
-0
Article.java
org/university/core/Article.java
+19
-0
Course.java
org/university/core/Course.java
+40
-0
Department.java
org/university/core/Department.java
+23
-0
GraduateStudent.java
org/university/core/GraduateStudent.java
+22
-0
Person.java
org/university/core/Person.java
+25
-0
Professor.java
org/university/core/Professor.java
+38
-0
ServiceEmaployee.java
org/university/core/ServiceEmaployee.java
+31
-0
Statement.java
org/university/core/Statement.java
+27
-0
Student.java
org/university/core/Student.java
+28
-0
UnderGradStudent.java
org/university/core/UnderGradStudent.java
+7
-0
No files found.
org/.DS_Store
0 → 100644
View file @
109c0858
File added
org/university/.DS_Store
0 → 100644
View file @
109c0858
File added
org/university/core/AbstractEmployee.java
0 → 100644
View file @
109c0858
package
org
.
university
.
core
;
import
java.util.*
;
public
abstract
class
AbstractEmployee
extends
Person
{
protected
ArrayList
<
Statement
>
bankStatements
;
protected
String
position
;
protected
Date
lastPromote
;
protected
double
basicIncome
;
public
AbstractEmployee
(
String
name
,
int
entranceYear
,
int
id
){
super
(
name
,
entranceYear
,
id
);
bankStatements
=
new
ArrayList
<>();
lastPromote
=
new
Date
();
}
public
String
getPosition
(){
return
position
;
}
public
void
addBankStatement
(
Statement
s
){
bankStatements
.
add
(
s
);
}
public
Statement
[]
getBankStatements
(){
Statement
[]
arr
=
new
Statement
[
bankStatements
.
size
()];
bankStatements
.
toArray
(
arr
);
return
arr
;
}
public
void
setBasicIncome
(
double
income
){
this
.
basicIncome
=
income
;
}
public
boolean
promote
(){
if
(
isPromotable
()){
lastPromote
=
new
Date
();
return
true
;
}
return
false
;
}
abstract
public
double
getCurrentIncome
();
abstract
public
boolean
isPromotable
();
}
org/university/core/Article.java
0 → 100644
View file @
109c0858
package
org
.
university
.
core
;
public
class
Article
{
private
String
name
;
private
int
year
;
public
Article
(){
this
.
name
=
name
;
this
.
year
=
year
;
}
public
String
getName
(){
return
name
;
}
public
int
getYear
(){
return
year
;
}
}
org/university/core/Course.java
0 → 100644
View file @
109c0858
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
GraduateStudent
teacherAssistance
;
public
GraduateStudent
getTeacherAssistance
()
{
return
teacherAssistance
;
}
public
void
setTeacherAssistance
(
GraduateStudent
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
);
}
}
org/university/core/Department.java
0 → 100644
View file @
109c0858
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
);
}
}
org/university/core/GraduateStudent.java
0 → 100644
View file @
109c0858
package
org
.
university
.
core
;
import
java.util.*
;
public
class
GraduateStudent
extends
Student
{
private
ArrayList
<
Article
>
articles
;
public
GraduateStudent
(
String
name
,
int
entranceYear
,
int
id
){
super
(
name
,
entranceYear
,
id
);
}
public
Article
[]
getArticles
(){
Article
[]
arr
=
new
Article
[
articles
.
size
()];
articles
.
toArray
(
arr
);
return
arr
;
}
public
void
addArticle
(
Article
c
){
articles
.
add
(
c
);
}
}
org/university/core/Person.java
0 → 100644
View file @
109c0858
package
org
.
university
.
core
;
public
class
Person
{
protected
String
name
;
protected
int
entranceYear
;
protected
int
id
;
public
Person
(
String
name
,
int
entranceYear
,
int
id
){
this
.
name
=
name
;
this
.
entranceYear
=
entranceYear
;
this
.
id
=
id
;
}
public
String
getName
(){
return
name
;
}
public
int
getEntranceYear
(){
return
entranceYear
;
}
public
int
getId
(){
return
id
;
}
}
org/university/core/Professor.java
0 → 100644
View file @
109c0858
package
org
.
university
.
core
;
import
java.util.*
;
public
class
Professor
extends
AbstractEmployee
{
private
ArrayList
<
Course
>
courses
;
private
String
group
;
public
Professor
(
String
name
,
int
entranceYear
,
int
id
){
super
(
name
,
entranceYear
,
id
);
courses
=
new
ArrayList
<>();
basicIncome
=
7000
;
}
public
double
getCurrentIncome
(){
return
courses
.
size
()
*
1000
+
basicIncome
;
}
public
Course
[]
getCourses
(){
Course
[]
arr
=
new
Course
[
courses
.
size
()];
courses
.
toArray
(
arr
);
return
arr
;
}
public
void
addCourse
(
Course
c
){
courses
.
add
(
c
);
}
public
String
getGroup
(){
return
group
;
}
public
boolean
isPromotable
(){
//TODO
return
true
;
}
}
org/university/core/ServiceEmaployee.java
0 → 100644
View file @
109c0858
package
org
.
university
.
core
;
import
java.util.*
;
public
class
ServiceEmaployee
extends
AbstractEmployee
{
public
int
extraWork
;
public
ServiceEmaployee
(
String
name
,
int
entranceYear
,
int
id
){
super
(
name
,
entranceYear
,
id
);
basicIncome
=
3
;
}
public
void
setExtraWork
(
int
extraWork
){
this
.
extraWork
=
extraWork
;
}
public
int
getExtraWork
(){
return
extraWork
;
}
public
double
getCurrentIncome
(){
return
extraWork
*
500
+
basicIncome
;
}
public
boolean
isPromotable
(){
long
dis
=
(
new
Date
()).
getTime
()
-
lastPromote
.
getTime
();
dis
/=
1000
*
3600
*
24
*
365
;
return
dis
>=
3
;
}
}
org/university/core/Statement.java
0 → 100644
View file @
109c0858
package
org
.
university
.
core
;
import
java.util.*
;
public
class
Statement
{
private
int
amount
;
private
Date
date
;
private
AbstractEmployee
receiver
;
public
Statement
(
int
amount
,
Date
date
,
AbstractEmployee
receiver
){
this
.
amount
=
amount
;
this
.
date
=
date
;
this
.
receiver
=
receiver
;
}
public
int
getAmount
(){
return
amount
;
}
public
Date
getDate
(){
return
date
;
}
public
AbstractEmployee
receiver
(){
return
receiver
;
}
}
org/university/core/Student.java
0 → 100644
View file @
109c0858
package
org
.
university
.
core
;
import
java.util.*
;
public
class
Student
extends
Person
{
protected
String
college
;
protected
ArrayList
<
Course
>
passedCourses
;
public
Student
(
String
name
,
int
entranceYear
,
int
id
){
super
(
name
,
entranceYear
,
id
);
passedCourses
=
new
ArrayList
<>();
}
public
String
getCollege
(){
return
college
;
}
public
Course
[]
getPassedCourses
(){
Course
[]
arr
=
new
Course
[
passedCourses
.
size
()];
passedCourses
.
toArray
(
arr
);
return
arr
;
}
public
void
addCourse
(
Course
c
){
passedCourses
.
add
(
c
);
}
}
org/university/core/UnderGradStudent.java
0 → 100644
View file @
109c0858
package
org
.
university
.
core
;
public
class
UnderGradStudent
extends
Student
{
public
UnderGradStudent
(
String
name
,
int
entranceYear
,
int
id
){
super
(
name
,
entranceYear
,
id
);
}
}
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