Computer Science > Research Paper > Florida International UniversityCOP 4814Lab 2. (All)
from abc import ABCMeta, abstractmethod """This serves as a template for Lab #2 - Strategy for Musical Instruments""" ############################################################################## ... # # Instruments ############################################################################## # """The Instrument interface contains one class variable named play_behavior and three methods: display, play and set_play_behavior""" class Instrument: __metaclass__ = ABCMeta # please include the class variable and the three required methods here @abstractmethod def display(self): pass def play(self): pass def set_play_behavior(self): pass """DoubleBass Class""" class DoubleBass(Instrument): def __init__(self): self.play_behavior = PlayWithBow() def display(self): print("I am a double bass.") def play(self): PlayWithBow.play(self) """Clarinet Class""" class Clarinet(Instrument): def __init__(self): self.play_behavior = BuzzAReed() def display(self): print("I am a clarinet.") def play(self): BuzzAReed.play(self) [Show More]
Last updated: 1 year ago
Preview 1 out of 4 pages
Connected school, study & course
About the document
Uploaded On
Jul 02, 2021
Number of pages
4
Written in
This document has been written for:
Uploaded
Jul 02, 2021
Downloads
0
Views
34
In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Browsegrades · High quality services·