Question: C++ program. please show it working, it should use prog7client.cpp prog7instrument.cpp prog7brass.cpp prog7string.cpp for the g++. Thank you!!! The text file that needs to be

C++ program. please show it working, it should use prog7client.cpp prog7instrument.cpp prog7brass.cpp prog7string.cpp for the g++. Thank you!!!

 C++ program. please show it working, it should use prog7client.cpp prog7instrument.cpp

prog7brass.cpp prog7string.cpp for the g++. Thank you!!! The text file that needs

to be read is prog7.txt S Messiah Stradivarius 18000000 1 4 S

The text file that needs to be read is prog7.txt

S

Messiah Stradivarius

18000000

1

4

S

The Titanic Violin

1700000

1

2

S

The Lady Tennant

2032000

1

4

S

The Hammer Stradivarius

3544000

1

4

B

French horm

8500

valves

brass

S

Eric Clapton's Blackie

959500

0

6

S

Jimmy Page's double-neck Gibson EDS-1275

1245600

0

12

S

Willie Nelson's Lucille

30

0

6

I

Bass drum

239

B

Trumpet

1200

valves

brass

I

Saxophone

3800

I

Piccolo

149

S

Jimi Hendrix's First Wife

1250000

0

6

Program Purpose For this program you are asked to use C++ inheritance to create a base class and two derived classes. You will also be working with constructors and redefining/overloading class member functions. Mandatory Instructions 1. Design a MusicalInstrument class that has the following members: - A member variable for the name of the instrument (string) - A member variable for the cost the instrument (double) - A default constructor that sets the name to the empty sting and the cost to zero An oerloaded constructor that accepts values for the name and cost and assigns them to the data members Accessors and mutators for the name and cost A virtual display function displayInstrument that displays the instument's name and the cost. Store the declaration for this class in a file called prog7instrument.h. Implement functions in cpp file of same name. 2. Design a BrassInsument class that is derived from the Musicallnsrument class with: - A member variable for the method of sound making (string): slides, valves, or ke - A member variable for the material from which the instrument is made (sting): brass or wood A default constructor that invokes the Musicallnstrument default constructor to initialize the inherited data members and sets the BrassInstrument fields to empty string. - A second constuctor that accepts an instument's name, cost, method of making sound, and material from which it is made. Pass the first two arguments to the MusicalUnstrument constructor and use the last two to set the BrassInstrment data members. - A displayInstrument function that overrides the displayInstrument function in the base class. It should display the instrument's name, cost, method of making sound, and material from which it is made. Store the declaration for the BrassInstrument class in the file prog7brass.h. Implement functions in cpp file of same name. 3. Design a StingInstrument class that is derived from the Musicallnsument class with: A member variable for the flag to indicate a bowed instrument (bool) - A member variable for the number of strings int) - - A default constructor that invokes the MusialInstrument default constructor to initialize the inherited data members and sets bowed flag to false and number of strings to zero A second constructor that accepts a string instrument'sname, cost, bowed flag, and number ofstrings. Pass the first two arguments to the MusicalInstrument constructor and use the last two to set the StringInstument's data members. - A displayInstrument function that overrides the displayInstrument function in the base class. It should first call the base class's function (to display the instument's name and cost) and then display the string instrument's data members. Store the declaration for the StringInstrument class in the file prog7string.h. Implement functions in cpp file of same name

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!