Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
Lab66
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
9731088
Lab66
Commits
d13886c8
Commit
d13886c8
authored
Apr 14, 2019
by
Roham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
YO
parent
5daefdf7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
181 additions
and
0 deletions
+181
-0
Course.java
src/com/university/Course.java
+38
-0
Department.java
src/com/university/Department.java
+59
-0
Professor.java
src/com/university/Professor.java
+27
-0
Student.java
src/com/university/Student.java
+32
-0
University.java
src/com/university/University.java
+15
-0
CourseTest.java
src/test/CourseTest.java
+5
-0
StudentTest.java
src/test/StudentTest.java
+5
-0
No files found.
src/com/university/Course.java
0 → 100644
View file @
d13886c8
package
com
.
university
;
public
class
Course
{
String
ID
;
public
Course
(
String
ID
,
String
name
,
Department
department
,
Professor
professor
,
int
credit
)
{
}
public
String
getID
(){
return
null
;
}
public
Department
getDepartment
(){
return
null
;
}
public
String
getName
()
{
return
null
;
}
public
Student
[]
getStudents
()
{
return
null
;
}
public
Professor
getProfessor
()
{
return
null
;
}
public
int
getCredit
()
{
return
0
;
}
public
void
enrollStudent
(
Student
student
){
}
}
src/com/university/Department.java
0 → 100644
View file @
d13886c8
package
com
.
university
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
Department
{
String
name
;
List
<
Student
>
students
;
List
<
Course
>
courses
;
List
<
Professor
>
professors
;
public
Department
(
String
name
)
{
this
.
name
=
name
;
this
.
students
=
new
ArrayList
<>();
this
.
courses
=
new
ArrayList
<>();
this
.
professors
=
new
ArrayList
<>();
}
public
String
getName
(){
return
this
.
name
;
}
public
void
addStudent
(
Student
student
){
this
.
students
.
add
(
student
);
}
public
Student
[]
getStudents
(){
return
(
Student
[])
this
.
students
.
toArray
();
}
public
void
removeStudent
(
Student
student
){
this
.
students
.
remove
(
student
);
}
public
void
addCourse
(
Course
course
){
this
.
courses
.
add
(
course
);
}
public
Course
[]
getCourses
(){
return
(
Course
[])
this
.
courses
.
toArray
();
}
public
void
removeCourse
(
Course
course
){
this
.
courses
.
remove
(
course
);
}
public
void
addProfessor
(
Professor
student
){
this
.
professors
.
add
(
student
);
}
public
Professor
[]
getProfessors
(){
return
(
Professor
[])
this
.
professors
.
toArray
();
}
public
void
removeProfessor
(
Professor
professor
){
this
.
professors
.
remove
(
professor
);
}
}
src/com/university/Professor.java
0 → 100644
View file @
d13886c8
package
com
.
university
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
Professor
{
Department
department
;
String
name
;
List
<
Course
>
courses
;
public
Professor
(
Department
department
,
String
name
)
{
this
.
department
=
department
;
this
.
name
=
name
;
this
.
courses
=
new
ArrayList
<>();
}
public
Department
getDepartment
()
{
return
this
.
department
;
}
public
String
getName
()
{
return
this
.
name
;
}
public
Course
[]
getCourses
()
{
return
(
Course
[])
this
.
courses
.
toArray
();
}
}
src/com/university/Student.java
0 → 100644
View file @
d13886c8
package
com
.
university
;
public
class
Student
{
public
Student
(
String
name
,
String
ID
,
String
major
,
Department
department
)
{
}
public
String
getName
()
{
return
null
;
}
public
String
getID
()
{
return
null
;
}
public
String
getMajor
()
{
return
null
;
}
public
Department
getDepartment
()
{
return
null
;
}
public
Course
[]
getCourses
()
{
return
null
;
}
public
void
addCourse
(
Course
course
){
}
}
src/com/university/University.java
0 → 100644
View file @
d13886c8
package
com
.
university
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
University
{
List
<
Department
>
departments
=
new
ArrayList
<>();
public
Department
[]
getDepartments
(){
return
(
Department
[])
this
.
departments
.
toArray
();
}
public
void
addDepartment
(
Department
department
){
this
.
departments
.
add
(
department
);}
public
void
removeDepartment
(
Department
department
){
this
.
departments
.
remove
(
department
);}
}
src/test/CourseTest.java
0 → 100644
View file @
d13886c8
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
CourseTest
{
}
\ No newline at end of file
src/test/StudentTest.java
0 → 100644
View file @
d13886c8
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
StudentTest
{
}
\ No newline at end of file
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