Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON: Demonstrate Inheritance 1) In the first step you will create a parent class. Create a parent class for Office Furniture. Set the class variables

PYTHON:

Demonstrate Inheritance

1) In the first step you will create a parent class. Create a parent class for Office Furniture. Set the class variables to be category (desk, chair, filing cabinet would be examples), material, length, width, height, and price. Include a method that returns a string about the object.

2. In the second step create a sub class for Desk that includes location_of_drawers (left, right both are options) and number_drawers. Override the parents __str__ method to include drawer location and count.

3. Implement each class in a separate file. Import these into your main program. Your main program should implement and display an instance of each, the parent class and the child class.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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