1401 Introduction to Computer Science
Motivation: to practice exceptions.
Fall 2014, Lab 12
Assignment. Define a class Course. The description
of each course should contain:
This class should contains:
- a class title,
corresponding major, and
- the number of students taking this
Make the constructor
method throw an IllegalArgumentException exception if someone
tries to input a negative number of students. Catch the exceptions
thrown by this method and print appropriate error messages.
- a constructor
- get- and set-methods.
Write a method that ask the user for the number of courses and
then forms an array of courses, by asking the user all this
information about the course.
Write a second method that, given an array of courses, prints this
information course by course.
When it is due. The program is due in the beginning of your
last lab session:
- on Wednesday December 3 for those who
attend Monday-Wednesday labs, and
- on Thursday December 4 for
those who attend Tuesday-Thursday labs.