Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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. cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions