ISM3255 Assignment 06

In this assignment, you will modify you two classes from ASG04: MainClass and Course

The Course class should have:

Attributes that can be read and written: (Use Shortened get and set)Description (text) // course name
Period (integer)
Credits (integer)
MaxEnrollment (integer) with the default value 30.
Attributes that are read-only:Id (text)
Section (integer)
A DEFAULT CONSTRUCTOR where MaxEnrollment is set to 30.
A parameterized CONSTRUCTOR that takes parameters for Id, Section, Description, Period, Credits, and MaxEnrollment and initializes the attributes to those parameters (USE CONSTRUCTORS)
Your parameterized Constructor should verify that MaxEnrollment is not greater than 30. If the input for MaxEnrollment is greater than 30, it should be automatically set to the default of 30.Hint: Check the “Car” example. You just need a simple if condition inside your parameterized constructor.
A method called PrintCourseInfo which will print out information about the course in the following format:
Business Systems 2 (Course ID: ISM3255, Section: 5555)

Period: 2

Credits: 2

Maximum Enrollment: 30

Once you have designed your course class, write a MainClass with a main method. Your main method should:

Instantiate a course objects (course1) with input from user (ReadLine for each attribute)Hint: Test your code with hardcoded values first, so that you don’t have to enter values every time you test your code.
Hint: Test your parameterized constructor by entering a value greater than 30 for MaxEnrollment
Print out course1 attributes using the PrintCourseInfo method you created
Powered by