Question: modify the below code as per the question above please (only c++ code) 8.1 Modify PROG8 4 and use a pointer to an object of



8.1 Modify PROG8 4 and use a pointer to an object of the Stereo composed class to dynamically allocate as many composed objects as requested by the user at run-time. Use the pointer to call the matching () member function for each composed object. PROGRAM EXAMPLE 8.4: PROG8_4 1//PROG84:Programdemonstratesacomposedclasscontaining2pointerstosubobjectsasmembers. 3 Inctude clostream? using namespace stdi clasa speaker i. float Impedance: poblic: Sprakerif //constructor 11 cout/ destructor +2 1 couts// composed constructor ptsponew Speaker; ptamp=new Amplifieri -ptspisi -ptamp=a; coutce"/ cConstructing stereo." getimp ()= ptamp-sgetimp ()) cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
