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
Aryan Boukani
Lab 9
Commits
a6013617
Commit
a6013617
authored
May 15, 2019
by
Aryan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First Commit
parents
Pipeline
#607
canceled with stages
Changes
13
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
321 additions
and
0 deletions
+321
-0
Lab 9.iml
Lab 9.iml
+12
-0
Main.java
src/Main.java
+8
-0
AbstractEmployee.java
src/org/university/core/AbstractEmployee.java
+44
-0
Course.java
src/org/university/core/Course.java
+40
-0
Department.java
src/org/university/core/Department.java
+25
-0
GraduateStudent.java
src/org/university/core/GraduateStudent.java
+24
-0
Person.java
src/org/university/core/Person.java
+41
-0
Professor.java
src/org/university/core/Professor.java
+45
-0
Publication.java
src/org/university/core/Publication.java
+13
-0
ServiceEmployee.java
src/org/university/core/ServiceEmployee.java
+21
-0
Statement.java
src/org/university/core/Statement.java
+21
-0
Student.java
src/org/university/core/Student.java
+23
-0
UnderGraduate.java
src/org/university/core/UnderGraduate.java
+4
-0
No files found.
Lab 9.iml
0 → 100644
View file @
a6013617
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
inherit-compiler-output=
"true"
>
<exclude-output
/>
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/src"
isTestSource=
"false"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
src/Main.java
0 → 100644
View file @
a6013617
import
java.util.*
;
public
class
Main
{
public
static
void
main
(
String
[]
args
)
{
}
}
src/org/university/core/AbstractEmployee.java
0 → 100644
View file @
a6013617
package
org
.
university
.
core
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
public
abstract
class
AbstractEmployee
extends
Person
{
private
ArrayList
<
Statement
>
bankStatement
;
private
String
position
;
private
double
basicIncome
;
public
AbstractEmployee
(){
}
public
AbstractEmployee
(
String
position
,
double
basicIncome
)
{
this
.
bankStatement
=
new
ArrayList
<
Statement
>();
this
.
position
=
position
;
this
.
basicIncome
=
basicIncome
;
}
public
String
getPosition
()
{
return
position
;
}
public
void
addBankStatement
(
Statement
bankStatement
)
{
this
.
bankStatement
.
add
(
bankStatement
);
}
public
ArrayList
<
Statement
>
getBankStatement
()
{
return
bankStatement
;
}
public
void
setBasicIncome
(
double
basicIncome
)
{
this
.
basicIncome
=
basicIncome
;
}
public
double
getCalPrice
(){
double
res
=
0
;
for
(
Statement
statement
:
bankStatement
)
res
+=
statement
.
getAmount
();
return
res
;
}
abstract
public
boolean
isPromotable
();
}
src/org/university/core/Course.java
0 → 100644
View file @
a6013617
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
);
}
}
src/org/university/core/Department.java
0 → 100644
View file @
a6013617
package
org
.
university
.
core
;
import
org.university.core.Course
;
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
);
}
}
src/org/university/core/GraduateStudent.java
0 → 100644
View file @
a6013617
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
GraduateStudent
extends
Student
{
private
ArrayList
<
Publication
>
publications
;
private
Professor
advisor
;
public
GraduateStudent
(
Professor
advisor
)
{
publications
=
new
ArrayList
<
Publication
>();
this
.
advisor
=
advisor
;
}
public
Professor
getAdvisor
()
{
return
advisor
;
}
public
void
addPublication
(
Publication
publication
)
{
publications
.
add
(
publication
);
}
public
ArrayList
<
Publication
>
getPublication
()
{
return
publications
;
}
}
src/org/university/core/Person.java
0 → 100644
View file @
a6013617
package
org
.
university
.
core
;
public
class
Person
{
private
String
firstName
;
private
String
lastName
;
private
String
id
;
private
int
joiningYear
;
private
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
Person
(){
}
public
String
getId
()
{
return
id
;
}
public
Department
getDepartment
()
{
return
department
;
}
public
int
getJoiningYear
()
{
return
joiningYear
;
}
public
String
getFullName
(){
return
firstName
+
lastName
;
}
public
void
setJoiningYear
(
int
joiningYear
)
{
this
.
joiningYear
=
joiningYear
;
}
}
src/org/university/core/Professor.java
0 → 100644
View file @
a6013617
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
Professor
extends
AbstractEmployee
{
private
ArrayList
<
Course
>
courses
;
private
String
group
;
private
ArrayList
<
Publication
>
publications
;
public
Professor
(
String
group
)
{
super
();
courses
=
new
ArrayList
<>();
publications
=
new
ArrayList
<>();
this
.
group
=
group
;
setBasicIncome
(
7
);
}
public
ArrayList
<
Course
>
getCourses
()
{
return
courses
;
}
public
String
getGroup
()
{
return
group
;
}
public
void
addCourse
(
Course
course
){
courses
.
add
(
course
);
}
public
void
addPublication
(
Publication
publication
){
publications
.
add
(
publication
);
}
@Override
public
boolean
isPromotable
()
{
if
(
publications
.
size
()
>=
10
){
setJoiningYear
(
0
);
return
true
;
}
return
false
;
}
}
src/org/university/core/Publication.java
0 → 100644
View file @
a6013617
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
;
}
//
}
src/org/university/core/ServiceEmployee.java
0 → 100644
View file @
a6013617
package
org
.
university
.
core
;
import
java.beans.Statement
;
import
java.util.ArrayList
;
public
class
ServiceEmployee
extends
AbstractEmployee
{
public
ServiceEmployee
(
String
position
,
double
basicIncome
)
{
super
(
position
,
basicIncome
);
setBasicIncome
(
3
);
}
@Override
public
boolean
isPromotable
()
{
if
(
getJoiningYear
()
>=
3
)
{
setJoiningYear
(
0
);
return
true
;
}
return
false
;
}
}
src/org/university/core/Statement.java
0 → 100644
View file @
a6013617
package
org
.
university
.
core
;
public
class
Statement
{
private
double
amount
;
private
AbstractEmployee
receiver
;
public
Statement
(
double
amount
,
AbstractEmployee
receiver
)
{
this
.
amount
=
amount
;
this
.
receiver
=
receiver
;
}
public
double
getAmount
()
{
return
amount
;
}
public
AbstractEmployee
getReceiver
()
{
return
receiver
;
}
}
src/org/university/core/Student.java
0 → 100644
View file @
a6013617
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
Student
extends
Person
{
private
ArrayList
<
Course
>
courses
;
public
Student
(){
}
public
Student
(
String
firstName
,
String
lastName
,
String
id
,
int
joiningYear
,
Department
department
)
{
super
(
firstName
,
lastName
,
id
,
joiningYear
,
department
);
courses
=
new
ArrayList
<>();
}
public
void
addCourse
(
Course
course
){
courses
.
add
(
course
);
}
public
ArrayList
<
Course
>
getCourses
(){
return
courses
;
}
}
src/org/university/core/UnderGraduate.java
0 → 100644
View file @
a6013617
package
org
.
university
.
core
;
public
class
UnderGraduate
extends
Student
{
}
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