My professor has given me additional information for this question: Create a class named CollegeCourse that includes data fields that hold the department (for example, ENG), the course number (for example, 101), the credits (for example, 3), and the fee for the course (for example, $360). All of the fields are required as arguments to the constructor, except for the fee, which is calculated at $120 per credit hour. Include a display() method that displays the course data. Create a subclass named LabCourse that adds $50 to the course fee. Override the parent class display() method to indicate that the course is a lab course and to display all the data. Write an application named UseCourse that prompts the user for course information. If the user enters a class in any of the following departments, create a LabCourse: BIO, CHM, CIS, or PHY. If the user enters any other department, create a CollegeCourse that does not include the lab fee. Then display the course data. Save the files as CollegeCourse.java, LabCourse.java, and UseCourse.java. This is what the professor wrote: NOTE: Include any & all Exception Handling necessary.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
My professor has given me additional information for this question:
Create a class named CollegeCourse that includes data fields that hold the
department (for example, ENG), the course number (for example, 101), the
credits (for example, 3), and the fee for the course (for example, $360). All of the
fields are required as arguments to the constructor, except for the fee, which is
calculated at $120 per credit hour. Include a display() method that displays
the course data. Create a subclass named LabCourse that adds $50 to the course
fee. Override the parent class display() method to indicate that the course is
a lab course and to display all the data. Write an application named UseCourse
that prompts the user for course information. If the user enters a class in any of
the following departments, create a LabCourse: BIO, CHM, CIS, or PHY. If the
user enters any other department, create a CollegeCourse that does not include
the lab fee. Then display the course data. Save the files as CollegeCourse.java,
LabCourse.java, and UseCourse.java.
This is what the professor wrote:
NOTE: Include any & all Exception Handling necessary.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 1 images