Sample Task Guideline and Code
Sample Task Guideline and Code
1. Class Structure:
Define a superclass named Course that contains the following attributes and
methods:
Attributes: courseCode (String), courseTitle (String), and courseInstructor
(String).
Methods:
Course(String courseCode, String courseTitle, String
courseInstructor): Constructor to initialize the attributes.
void displayCourseInfo(): Method to display the course information
(course code, course title, and course instructor).
Define a subclass named OnlineCourse that extends the Course class. This subclass
should include the following:
Additional attribute: platform (String) representing the online platform used
for the course.
Implement the constructor to initialize all attributes (courseCode,
courseTitle, courseInstructor, and platform).
Override the displayCourseInfo() method to also display the online platform
of the course.
2. Object Creation:
Create an object of the OnlineCourse class and initialize it with appropriate values
for all attributes.
Display the information of the online course using the displayCourseInfo() method.
TIPS:
Read and analyze the problem and conceptualize the possible output.
If having hard time to understand problem try using diagram as your
lead.
Practice coding using your own problem or inputs.
Don’t memorize the whole codes instead familiarize the order of
algorithm, keywords and syntax.
VERY, VERY, VERY Basic -------> Sample Code
//Thank you!!!!
//Good luck