Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

13.7 (LAB) (Python 3) Create CD Radio (Inheritance) Below you'll find a Radio class. It has a volume attribute and a radio station attribute You

image text in transcribed

image text in transcribed

13.7 (LAB) (Python 3) Create CD Radio (Inheritance) Below you'll find a Radio class. It has a volume attribute and a radio station attribute You should create a new class called CDRadio that inherits from the Radio class (1 pt) The init should take volume, station and a mode attribute. (The mode attribute is a string and will default to "Radio, It can also be set to CD" when it switches to listening to a cd.) During the init you should use an unbound method call to set the volume and station attributes. 4 pts) You should create a str method for your class that returns the string representation of a CD Radio. If the mode is radio it should make an unbound method call and return the Radio str method. (1 pt) If the mode is 'CD" it should return "Volume: 80 - Playing CD", Where 80 would be replaced by the current volume of the radio. (1 pt) ACTIVITY 137.1: (LAB) (Python 3) Create CD Radio (Inheritance) Files provided by your instructor main.py Download main.py Load default template... 1 class Radio(object): 3 def init_ (self, volmeint 2a, station: float 88.2) Initiolize the radio to default volues for volume and FM Station self.volume volume self.station - station 8 def str(self): return "Volume Station::1f.format(self.volume, self.station) 13.7 (LAB) (Python 3) Create CD Radio (Inheritance) Below you'll find a Radio class. It has a volume attribute and a radio station attribute You should create a new class called CDRadio that inherits from the Radio class (1 pt) The init should take volume, station and a mode attribute. (The mode attribute is a string and will default to "Radio, It can also be set to CD" when it switches to listening to a cd.) During the init you should use an unbound method call to set the volume and station attributes. 4 pts) You should create a str method for your class that returns the string representation of a CD Radio. If the mode is radio it should make an unbound method call and return the Radio str method. (1 pt) If the mode is 'CD" it should return "Volume: 80 - Playing CD", Where 80 would be replaced by the current volume of the radio. (1 pt) ACTIVITY 137.1: (LAB) (Python 3) Create CD Radio (Inheritance) Files provided by your instructor main.py Download main.py Load default template... 1 class Radio(object): 3 def init_ (self, volmeint 2a, station: float 88.2) Initiolize the radio to default volues for volume and FM Station self.volume volume self.station - station 8 def str(self): return "Volume Station::1f.format(self.volume, self.station)

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

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions