Code in C++ Using inheritance AND composition create a program to incorporate th
ID: 3935594 • Letter: C
Question
Code in C++
Using inheritance AND composition create a program to incorporate the following data members into the following classes appropriately.
Data members: price (float), company name (string), memory (int), display size (float), watts (int)
Electronics
Manufacturer
TV
Computer
Receiver
1. Comply with the DRY principle (look for repeated data).
2. Instantiate and initialize an object of type TV.
3. Display ALL the appropriate information for the object.
Explanation / Answer
#include using namespace std; class tv { public: string companyname; int memory; int watts; float prize; float displaysize; tv(): companyname("onida"), memory(16), price(45000.00) ,watts(240) { } public : void display() { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.