Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
lab_9
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
9731065
lab_9
Commits
d0595d7b
Commit
d0595d7b
authored
May 14, 2019
by
9731065
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Professor complitted
parent
5c0b2af2
Pipeline
#599
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
1 deletion
+50
-1
Employee.java
src/Employee.java
+3
-1
Person.java
src/Person.java
+7
-0
Professor.java
src/Professor.java
+31
-0
ServiceEmployee.java
src/ServiceEmployee.java
+9
-0
No files found.
src/Employee.java
View file @
d0595d7b
...
@@ -4,7 +4,8 @@ public abstract class Employee extends Person {
...
@@ -4,7 +4,8 @@ public abstract class Employee extends Person {
protected
ArrayList
<
Statement
>
statements
=
new
ArrayList
<>();
protected
ArrayList
<
Statement
>
statements
=
new
ArrayList
<>();
protected
String
position
;
protected
String
position
;
protected
double
basicIncome
;
protected
double
basicIncome
;
public
Employee
(
String
position
){
public
Employee
(
String
firstName
,
String
lastName
,
String
id
,
int
joiningYear
,
Department
department
,
String
position
){
super
(
firstName
,
lastName
,
id
,
joiningYear
,
department
);
this
.
position
=
position
;
this
.
position
=
position
;
}
}
...
@@ -26,4 +27,5 @@ public abstract class Employee extends Person {
...
@@ -26,4 +27,5 @@ public abstract class Employee extends Person {
public
void
addBankStatement
(
Statement
statement
){
public
void
addBankStatement
(
Statement
statement
){
this
.
statements
.
add
(
statement
);
this
.
statements
.
add
(
statement
);
}
}
public
abstract
double
getCurrentIncome
();
}
}
src/Person.java
View file @
d0595d7b
...
@@ -4,6 +4,13 @@ public abstract class Person {
...
@@ -4,6 +4,13 @@ public abstract class Person {
protected
String
id
;
protected
String
id
;
protected
int
joiningYear
;
protected
int
joiningYear
;
protected
Department
department
;
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
getFullName
()
{
public
String
getFullName
()
{
return
firstName
+
" "
+
lastName
;
return
firstName
+
" "
+
lastName
;
...
...
src/Professor.java
0 → 100644
View file @
d0595d7b
import
java.util.ArrayList
;
public
class
Professor
extends
Employee
{
private
ArrayList
<
Course
>
courses
=
new
ArrayList
<>();
private
String
group
;
public
Professor
(
String
firstName
,
String
lastName
,
String
id
,
int
joiningYear
,
Department
department
,
String
position
,
String
group
){
super
(
firstName
,
lastName
,
id
,
joiningYear
,
department
,
position
);
this
.
group
=
group
;
}
public
ArrayList
<
Course
>
getCourses
()
{
return
courses
;
}
public
String
getGroup
()
{
return
group
;
}
public
void
addCourse
(
Course
c
){
courses
.
add
(
c
);
}
@Override
public
double
getCurrentIncome
()
{
double
sum
=
0
;
for
(
int
i
=
0
;
i
<
this
.
statements
.
size
();
i
++)
{
sum
+=
this
.
statements
.
get
(
i
).
getAmount
();
}
return
this
.
basicIncome
+
sum
;
}
}
src/ServiceEmployee.java
0 → 100644
View file @
d0595d7b
public
class
ServiceEmployee
extends
Employee
{
@Override
public
double
getCurrentIncome
(){
return
this
.
basicIncome
;
}
public
ServiceEmployee
(
String
firstName
,
String
lastName
,
String
id
,
int
joiningYear
,
Department
department
,
String
position
){
super
(
firstName
,
lastName
,
id
,
joiningYear
,
department
,
position
);
}
}
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