Course Program
Description
This program uses OOP aggregation (composition) concept to design classes to represent course object.Each course object includes data members representing the course number, course title, credit hours, location, instructor, book, starting date, ending date, and student list.
The program defines Book, Instructor, MyDate, Student, and Course classes.
The Course class incorporates the aggregation technique to includes the objects of Book, Instructor, Student, and MyDate as data members.
This problem was originally presented as an example in Starting out with Java 4th Edition book (page 515).
Authors: Tony Gaddis and Godfrey Muganda
The requirements are expanded to meet our purpose.
Associated Concepts:
OOP - Aggregation
Algorithm:
Class diagrams:
Client program:
Client program:
Call addCourse method to create a Course object
Use the Course object reference to add the starting and ending dates
Use the Course object reference to add the Student list
Use the Course object reference to add the Book
Use the Course object reference to add the Instructor
Print the result
Use the Course object reference to add the starting and ending dates
Use the Course object reference to add the Student list
Use the Course object reference to add the Book
Use the Course object reference to add the Instructor
Print the result
Source Code
Book classInstructor class
Student class
MyDate class (package jym.edu.rctc.courseproject;)
Course class
Client program
It includes the code to create the Course object and add the starting date,
the ending date, and the student list.
You can complete the program by writing the code to add Book and Instructor objects to the Course object.
You can complete the program by writing the code to add Book and Instructor objects to the Course object.