I made some changes in my previous program and tried to debug. there are no errors but i am not getting correct output. can some one please correct me where am i wrong..
The program required is to create classes that represents musical instruments such as; piano, violin, trumpet which are classified as stringed, woodwind, percussion instruments and all of them could be derived from a class instrument. Functions play() and tune-up() would be used by all instruments whereas polish() would only be used by brass instruments and strum() and pluck() would only be available to stringed instruments. The actual functions can simply print out the action of the instrument.
First call is polish(Brass) which calls Brass.play(middleC) which couts << "Piano::play\n"
Then you call strum(Stringed) which calls Stringed.play(middleC) which couts << "Violin::play\n"
Then you call pluck(Stringed) which calls Stringed.tune_up(middleC) which only returns a C-string, which you do nothing with.
Yes i am getting the same output...
The actual output should be the action of the instruments..!!
I think there is something wrong in the main program but not able to understand what to do...
As its mention the function must print out the action of the instrument so i am expecting the output should be like Brass- play, tune_up and polish, Stringed- play, tune_ up, strum and pluck..
Thank u that made me understand where i was wrong.. But still i am not able to find how can i display the action of instrument in the call functions..!!!