Question: 2 . 9 LAB: Course information ( derived classes ) Define a Course base class with the following attributes: number - course number title -
LAB: Course information derived classes
Define a Course base class with the following attributes:
number course number
title course title
Define a printinfo method in Course that displays the course number and title.
Also define a derived class OfferedCourse with the additional attributes:
instructorname instructor name
location class location
classtime class time
Ex: If the input is:
ECE
Digital Systems Design
ECE
Embedded Systems Design
Mark Patterson
Wilson Hall
WF: : pm class Course:
# TODO: Define constructor with attributes
# TODO: Define printinfo
class OfferedCourseCourse:
# TODO: Define constructor with attributes
if namemain:
coursenumber input
coursetitle input
ocoursenumber input
ocoursetitle input
instructorname input
location input
classtime input
mycourse Coursecoursenumber, coursetitle
mycourse.printinfo
myofferedcourse OfferedCourseocoursenumber, ocoursetitle, instructorname, location, classtime
myofferedcourse.printinfo
printf Instructor Name: myofferedcourse.instructorname
printf Location: myofferedcourse.location
printf Class Time: myofferedcourse.classtime
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
