Description
OOP Concepts
Introduction
It is required to implement a software for a college.
The college has departments for example (Computer, Electricity, Mechanical,..etc).
Each department has some courses for example (Math, OOP, Law,..etc) Also, there are many professors and students in the college.
Requirements
It is required from you to implement a simple system for the college. We will extend this assignment features/requirements in the next assignments in this course.
Implement each entity (College, Department, Course, Professor, Student) as a class with the following attributes/methods…
College
Attributes: departments, students, professors, courses
Methods:
int numberOfDepartments() int numberOfCourses() int numberOfProfessors() int numberOfStudents()
Department findDepartment(String name) // find department with name
Student findStudent(String name) // find student by full name
Professor findProfessor(String name) // find professor by full name
Course findCourse (String name) // find course by its name
Department
Attributes: name, description, max_number_of_students, courses, students
Methods:
int numberOfCourses() int numberOfStudents()
Course findCourse(String name) // find course by name boolean isFull() // return true if number of students equals max number of students
boolean enroll(Student s) // assign student to this department. Student can’t be enrolled to department if the department is full
Course
Attributes: name, description, max_number_of_students, number_of_lectures, students, professor, department.
Methods:
int numberOfStudents()
boolean assignProfessor(Professor p) // assign professor to course. Course can have only one professor. void unassignProfessor(Professor p) // dessign professor from course. boolean isAssigned() // return true if course is assigned to a professor. String professorName() // return professor full name boolean isFull() // return true if number of students equals max number of students
boolean enroll(Student s) // assign student to this course. Student can’t be enrolled to a course if the course is full. Student can’t be enrolled to a course if he isn’t enrolled in its department.
Professor
Attributes: firstName, lastName, telephone, address, salary, courses.
Methods:
String fullName() // return “firstName lastName” double getRaise(double ratio) // recalculate professor salary
Student
Attributes: firstName, lastName, telephone, address, age, department, courses
Methods:
String fullName() // return “firstName lastName”
Notes:
You should implement constructors for each class.
You should implement getters and setters when needed.
User can’t create new colleges. You will have only one college object in your main test class.
You can add more attributes/methods to any class if you need.
The fixed size for any array is 50 All objects names will be unique.
Sample Run (inputs in green)
Welcome to our university!
Operations:
1- College
a) Number of Departments
b) Number of Courses
c) Number of Professors
d) Number of Students
e) Report 2- Department
a) New
b) Number of Courses
c) Number of Students
d) Is Full
e) Enroll
f) Report 3- Course
a) New
b) Number of Students
c) Assign
d) Is assigned
e) Professor Name
f) Is Full
g) Enroll
h) Report
4- Professor
a) New
b) Display Salary
c) Get Raise
d) Report 5- Student
a) New
b) Report 6- Quit
============ Enter Operation
============
2a
Department Name:
Computer
Department Description:
Software Programming
Department Max Students:
1
============ Enter Operation
============
1a
1
============ Enter Operation
============
3a
Course Name:
OOP
Course Description: Object oriented concepts
Course Max Students:
1
Course Lectures:
10
Department:
Computer
============ Enter Operation
============
1b
1
============ Enter Operation
============
4a
Professor Firstname: Mohamed
Professor Lastname:
Amr
Professor Telephone:
0123456789
Professor Address:
Egypt Alexandria
Professor Salary:
3000
============ Enter Operation ============
5a
Student Firstname: Student
Student Lastname:
One
Student Telephone:
0123456789
Student Address: Egypt Alexandria Student Age:
20
============ Enter Operation ============
2e
Department:
Computer Student:
Student One
============ Enter Operation
2c
Department:
Computer
1
============ Enter Operation ============
2e
Department:
Computer
False
============ Enter Operation ============ 3g
course:
OOP
Student:
Student One
============ Enter Operation ============
2c
Department:
Computer
1
Enter Operation ============
4c
Professor:
Mohamed Amr
Raise:
0.1
Salary:3300
============ Enter Operation ============ 3c course:
OOP
professor:
Mohamed Amr
============ Enter Operation ============
1e
1 Professors
1 Students
1 Departments
1 Courses
============ Enter Operation 2f
Department:
Computer
Description: Software Programming
Max Students: 1
Students: 1
Status: Full
Courses: 1
============ Enter Operation
============
3h
Course:
OOP
Description: Object oriented concepts
Department: Computer
Lectures: 10
Max Students: 1
Students: 1
Status: Full
Professor: Mohamed Amr
============ Enter Operation
============
4d
Professor:
Mohamed Amr
Salary: 3300
Courses: OOP
Telephone: 0123456789
Address: Egypt Alexandria
============ Enter Operation
============
5b
Student:
Student One
Courses: OOP
Telephone: 0123456789
Address: Egypt Alexandria
Age: 20






