Create a directory named a5 in your repository. Include in a5 all of the files described below. Include in each source code file a package declaration.
Write an interface named Course that represents a college course.
- The interface should require access methods (getters) for a catalog number (String), title (String), and number of credits (int).
Write a class named TravelCourse that implements the Course interface.
- A travel course has a destination (String) along with an access method (getter function) for the field.
- The class should set all of its fields in the constructor using arguments passed to the constructor.
Write a class named TravelCourseSection that is a subclass of TravelCourse.
- A travel course section has a section number (int) and an instructor (String).
- The constructor should set all of the class fields using the values of the arguments passed into the constructor.
- The class should have access methods to get the values stored in the fields but should not contain modifier methods.
Write a driver class named Driver that creates two objects of type TravelCourseSection for a 3-credit course numbered FRE-310 with the title Exploring Paris and the destination Paris.
- The first object should have section 1 with Smith as instructor.
- The second object should have section 2 with Wallace as instructor.
- After creating both instances of the TravelCourseSection class, for each instance, print out all of the values of the fields of the instance.
© 2017 – 2019, Eric. All rights reserved.