A) Create a super (parent) class called Course. The Course class represents any course that does not have a lab (without a lab). The class should include the followings:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Example-2
A) Create a super (parent) class called Course. The Course class represents any course that
does not have a lab (without a lab). The class should include the followings:
*Private attributes:
o courseCode (type string)
o examMark (type double)
O courseWorkMark (type double)
"A constructor that initializes the three attributes of the class.
*A public and static variable called noOfCourses (stands for number of courses). The
initial value for this variable is 0 and it increases with every new course object created.
A public method called finalMark () which returns the total sum of course' marks. The
total mark is computed as (examMark + courseWorkMark).
"A public and static method called getNoOfCourses(). it returns the total number of
courses created.
•An overriden method called toString(), which returns a string that represents the Course
object.
fppt.com
Example-2
B) Extend the above Course code by creating a sub (child) class called CourseLab.
The CourseLab inherits the super class Course. The class should include the followings:
*An attribute called labMark (type double), which represents the mark of the lab.
•A constructor that initializes the attributes of the class. (Hint: don't forget to consider the
super class' constructor using the keyword: super).
*An overriden method called finalMark (), which returns the total sum of course' marks in
this sub class. The total mark in this case is computed as (examMark + course WorkMark +
labMark).
"An overriden method called toString(), which returns a string that represents the
CourseLab object.
C) Write an application with a main Method that creates objects from the classes Course and
CourseLab and displays the objects information. Your application code should also display
the total number of courses that have been created.
Transcribed Image Text:Example-2 A) Create a super (parent) class called Course. The Course class represents any course that does not have a lab (without a lab). The class should include the followings: *Private attributes: o courseCode (type string) o examMark (type double) O courseWorkMark (type double) "A constructor that initializes the three attributes of the class. *A public and static variable called noOfCourses (stands for number of courses). The initial value for this variable is 0 and it increases with every new course object created. A public method called finalMark () which returns the total sum of course' marks. The total mark is computed as (examMark + courseWorkMark). "A public and static method called getNoOfCourses(). it returns the total number of courses created. •An overriden method called toString(), which returns a string that represents the Course object. fppt.com Example-2 B) Extend the above Course code by creating a sub (child) class called CourseLab. The CourseLab inherits the super class Course. The class should include the followings: *An attribute called labMark (type double), which represents the mark of the lab. •A constructor that initializes the attributes of the class. (Hint: don't forget to consider the super class' constructor using the keyword: super). *An overriden method called finalMark (), which returns the total sum of course' marks in this sub class. The total mark in this case is computed as (examMark + course WorkMark + labMark). "An overriden method called toString(), which returns a string that represents the CourseLab object. C) Write an application with a main Method that creates objects from the classes Course and CourseLab and displays the objects information. Your application code should also display the total number of courses that have been created.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education