Create a base class called Device which includes the basic attributes and member functions related to any digital device. The data members of this class include the following: String variable which...


Create a base class called Device which includes the basic attributes and member functions related to any digital<br>device. The data members of this class include the following:<br>String variable which contains the device name.<br>Double variable which is the price of the device.<br>For this class you should provide the following public member functions:<br>a) Provide a constructor function that enables an object of this class to be initialized when it is declared.<br>b) Info(): prints all the data related to any device object.<br>c) Set and get functions for all data members.<br>d) Destructor that prints any statement you want.<br>Write another class called Mobile which is derived from class Device.<br>Class Mobile includes the following additional private data members:<br>Double variable which contains the CPU speed of the mobile.<br>Integer variable that contains the RAM size.<br>For this class you should provide the following public member functions:<br>a) Provide a constructor function that enables an object of this class to be initialized when it is declared. The<br>constructor should contain default values (for the base and derived classes' data members) in case no<br>initializers are provided.<br>b) Mobilelnfo () function in the appropriate format. This function should print all data member values.<br>c) One set function for all data members.<br>d) Get functions for all data members.<br>e) Destructor that call function Mobileinfo() then print

Extracted text: Create a base class called Device which includes the basic attributes and member functions related to any digital device. The data members of this class include the following: String variable which contains the device name. Double variable which is the price of the device. For this class you should provide the following public member functions: a) Provide a constructor function that enables an object of this class to be initialized when it is declared. b) Info(): prints all the data related to any device object. c) Set and get functions for all data members. d) Destructor that prints any statement you want. Write another class called Mobile which is derived from class Device. Class Mobile includes the following additional private data members: Double variable which contains the CPU speed of the mobile. Integer variable that contains the RAM size. For this class you should provide the following public member functions: a) Provide a constructor function that enables an object of this class to be initialized when it is declared. The constructor should contain default values (for the base and derived classes' data members) in case no initializers are provided. b) Mobilelnfo () function in the appropriate format. This function should print all data member values. c) One set function for all data members. d) Get functions for all data members. e) Destructor that call function Mobileinfo() then print "Bye" . In the main, you have to test the member functions of the base and derived class.
Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here