Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 . 9 LAB: Course information ( derived classes ) Define a Course base class with the following attributes: number - course number title -

2.9 LAB: Course information (derived classes)
Define a Course base class with the following attributes:
number - course number
title - course title
Define a print_info() method in Course that displays the course number and title.
Also define a derived class OfferedCourse with the additional attributes:
instructor_name - instructor name
location - class location
class_time - class time
Ex: If the input is:
ECE287
Digital Systems Design
ECE387
Embedded Systems Design
Mark Patterson
Wilson Hall 231
WF: 2-3:30 pm class Course:
# TODO: Define constructor with attributes
# TODO: Define print_info()
class OfferedCourse(Course):
# TODO: Define constructor with attributes
if __name__=="__main__":
course_number = input()
course_title = input()
o_course_number = input()
o_course_title = input()
instructor_name = input()
location = input()
class_time = input()
my_course = Course(course_number, course_title)
my_course.print_info()
my_offered_course = OfferedCourse(o_course_number, o_course_title, instructor_name, location, class_time)
my_offered_course.print_info()
print(f' Instructor Name: { my_offered_course.instructor_name }')
print(f' Location: { my_offered_course.location }')
print(f' Class Time: { my_offered_course.class_time }')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions

Question

12.6 Analyze the emerging emphasis on employee recognition.

Answered: 1 week ago