Module 3 - Lab - University

 Objective

The goal of this lab assignment is to bolster your understanding of object-oriented programming in Java, particularly the concept of aggregation. This is a powerful concept in object-oriented design where one class becomes a part of another class, but both can exist independently.

Instructions:

  1. Create the Course class: This class will have the attributes: courseName and courseCode.

    1.1. Both attributes will be set by user input.

    1.2. Include appropriate getter and setter methods for these attributes.

  2. Create the Professor class: This class will have the attributes: professorName, department, and course.

    2.1. The professorName and department attributes will be set by user input.

    2.2. The course attribute will be an object of the Course class.

    2.3. Include appropriate getter and setter methods for these attributes.

  3. Create the University class: This class will have the attributes: universityName, location, and professor.

    3.1. The universityName and location attributes will be set by user input.

    3.2. The professor attribute will be an object of the Professor class.

    3.3. Include appropriate getter and setter methods for these attributes.

  4. Write your main program:

    4.1. Use the Scanner class to collect user input for the course name and code, professor's name and department, and university's name and location.

    4.2. Instantiate the Course, Professor, and University classes with the information provided by the user.

    4.3. Finally, output the information about the university, professor, and course in a neat and clear format.

Don't forget to follow best practices such as using appropriate naming convention, and including comments to describe your code.

Note: Use Copy constructors where appropriate

 Deliverables

Upload the following files in a zip folder that you have created:

  1. Java class files

  2. Screenshot of the Console with the code executing

 

COSC-1437 / ITSE-2457 Computer Science Dept. - Author: Dr. Kevin Roark