Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started