Question: C++ Construct a program that dynamically creates an array of pointers to Televisions Prompt the user for the number of TV's to create and dynamically
C++
- Construct a program that dynamically creates an array of pointers to Televisions
- Prompt the user for the number of TV's to create and dynamically create a properly sized array of pointers (be sure to initialize the array elements to NULL),
- Populate the array with dynamically created televisions (prompt the user for the required information, create the object, and assign to the array).
- Loop through the array and display a description of each TV (using pointer notation to access the TV's various accessor methods like getMake(), getModel())
- When the program finishes it should deallocate each element in the array and then deallocate the array itself. Note both steps are needed to properly release the memory used for the dynamically created objects as well as the memory used for the dynamically created array.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
