Inheritance Lab Report
Inheritance Lab Report
Gentry-Kolen
COMSC 210
23 February 2020
Assignment Description:
Create a class called Musicians to contain three functions string ( ), wind ( ) and perc ( ).
Each of these functions should initialize a string array to contain the following instruments:
It should also display the contents of the arrays that are initialized.Create a derived class called
TypeIns to contain a function called get ( ) and show ( ). The get ( ) function must display a
means as follows:
a. String instruments
b. ind instruments
c. Percussion instruments
The show ( ) function should display the relevant detail according to our choice. The base class
• Solution: The program implements a base class called Musicians that contained the
arrays and the functions to assign and display the arrays, followed by a derived class
called Typeins which added functions to get and show the data stored in the arrays of
• Flowchart:
Class: Musicians
Protected:
string stringArr[5];
string windArr[5];
string percArr[5];
Public:
Void strings()
Void wind()
Void perc()
Class: Typeins
Public:
Int get()
Void show()
o Properly deciding the access modifier for members of each class to adequately
allow proper permissions for the derived class and main class.
o Constructing a functioning UI that allows for effective input as well as efficiency.
• Screenshots:
o When asking for user input, if the value is not 1,2, or 3, the program does not do
• Lessons Learned:
o What went well: The program was successfully implemented and allowed the
more seamless and smooth. Right now, the only way to quit was to type -1, but