Question: Create a Python program using good object-oriented skills that demonstrates the use of inheritance within multiple classes of a project. Create a base class named

Create a Python program using good object-oriented skills that demonstrates the use of inheritance within multiple classes of a project. Create a base class named Instrument. This class will hold the info for all types of instruments: Name (type of instrument: guitar, drums, etc...) Manufacturer Year built Cost Next, create these classes: Strings Wind Percussion String instruments will have these items: number of strings number of frets is it bowed? (true or false) Wind instruments will have these items: surface type number of reeds number of holes Percussion instruments will have these items: number of drumheads (membranes) shell type striking instrument? (true or false) Each of these three classes (String, Wind, and Percussion) should be inherited from the Instrument base class. Populate the values according to the input data. In the input file, named Instruments.txt, a new instrument will begin with a 'P' for percussion, 'S' for string, and 'W' for wind.

Be sure to:

read until end of file

create a base class named Instrument

comment throughout the code

create 3 classes (String, Wind, Percussion) that will inherit from the Instrument class

use functions throughout the program. Each function should be modular and completes one task only.

add a header and closing statement

use classes and objects appropriately

Create a Python program using good object-oriented skills that demonstrates the useof inheritance within multiple classes of a project. Create a base class

An example of the input data: P Drums Zildjian 2015 2500 4 Wood True S Guitar Gibson 2002 1200 6 19 False W Flute Yahama 2020 1550 Silver 0 16 Thonntwntwnond hen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!