Question: Question 3 [20 marks]: We have a class called electronic device that shows the information of an electronic device with two attributes: serial_number and year_built.

 Question 3 [20 marks]: We have a class called electronic devicethat shows the information of an electronic device with two attributes: serial_numberand year_built. The classes phone and laptop are inherited from electronic device.We have another class called smartphone that inherits from phone class. The

Question 3 [20 marks]: We have a class called electronic device that shows the information of an electronic device with two attributes: serial_number and year_built. The classes phone and laptop are inherited from electronic device. We have another class called smartphone that inherits from phone class. The code is provided bellow: #include using namespace std; class electronic_device{ protected: string serial_number; int year_built; public: electronic device(); electronic device(string s, int a); /*getters and setters*/ virtual void print() { coutprint(); delete e; return 0; } 3-d) [5 marks] Write the code for creating a dynamic object of smart phone class with these initial values: serial_number: "samsung123", year_built: 2020, number of camera:3, number_of_apps: 15. Then explain when you create these object which constructors and in which order they are called

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!