Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 PYTHON Lesson Classes Implement the following program: 1) Define a class Employee with three string attributes name, title, school. 2) Define an init

Question 3 PYTHON
Lesson Classes
Implement the following program:
1) Define a class Employee with three string attributes name, title, school.
2) Define an init method/function for Employee which sets the attribute values
via input parameters. The default values for Title and School are "TBD" and
"Unknown" respectively.
3) Define a print method/function that prints all attributes of Employee.
4) Define a class Course with a parent class of Employee with three attributes:
string Dept, string Course Number and integer credits.
5) The Course Class has a Parent Class object of type Employee.
6) Define an init method/function for Course which sets the attribute values via
input parameters.
7) Define a print method/function for Course which prints all attribute values of
both the Parent Class Employee and Child Class of Course.
8) Create an instance of Employee with the values
"Stephen Rose",
"Professor"
and
"Queensborough".
9) Call the Employee print function.
10) Create an instance of Course with the values
"James Bond", "Adjunct"
"Queensborough", "ET","ET-574" ,4
11) Call the Course print function.
Example Output
Employee
Name : Stephen Rose Title : Professor School : Queensborough
Course:
Name : James Bond Title : Adjunct School : Queensborough
Department: ET Course Number : ET-574 Credits : 4
image text in transcribed
Lesson Classes implement the following program: 1) Define a class Employee with three string attributes name, title, school. 2) Define an init method/function for Employee which sets the attribute values via input parameters. The default values for Title and School are "TBD" and "Unknown" respectively. 3) Define a print method/function that prints all attributes of Employee. 4) Define a class Course with a parent class of Employee with three attributes: string Dept, string Course Number and integer credits. 5) The Course Class has a Parent Class object of type Employee. 6) Define an init method/function for Course which sets the attribute values via input parameters. 7) Define a print method/function for Course which prints all attribute values of both the Parent Class Employee and Child Class of Course. 8) Create an instance of Employee with the values "Stephen Rose", "Professor" and "Queensborough". 9) Call the Employee print function. 10) Create an instance of Course with the values "James Bond", "Adjunct", "Queensborough", "ET", "ET-574", 4 11) Call the Course print function. Example Output Employee = Name: Stephen Rose Title: Professor School: Queensborough Course = lame: James Bond Title: Adjunct School: Queensborough partment: ET Course Number: ET-574 Credits : 4

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

Students also viewed these Databases questions

Question

Fingerprint evidence is admissible in court. Should it be?

Answered: 1 week ago

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago