ScholarMatic | 24/7 Homework Help

ScholarMatic Will Help You Write Your Essays and Term Papers

Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.

Consider the following class: class Computer { public:

by | Nov 28, 2023 | engineering

Consider the following class: class Computer { public: Computer(); Computer(int s, int mm, int hm); void display_specs(ostream & out)const; int get_speed()const; int get_mmemory()const; int get_hmemory()const; private: int speed; int main_memory; int harddisk_memory; };

(a) Implement class Computer.

(b) Test class Computer in a driver program that does the following:

? instantiates an object of class Computer, with the following details:

speed: 1600

main memory: 4

hard disk: 16

? use the accessor functions to display the specifications of the instantiated object on the console

? display the specifications of the instantiated object on the console with the member function display_specs().

(c) Derive and implement a class Laptop from class Computer. This class has additional member variables, battery_time and weight. Class Laptop also has an overloaded constructor and member functions, get_battime() and get_weight()to return member variables battery_time and weight respectively. The class Laptop should override function display_specs() in order to display the member variables of Laptop.

Implement the overloaded constructor for the class Laptop by invoking the base class constructor.

(d) Test class Laptop in a driver program that does the following:

? instantiates an object of class Laptop, with the following details:

speed: 1333

main memory: 2

hard disk: 8

battery time: 8

weight: 1.25

? use the accessor functions to display the specifications of the instantiated object on the console.

ScholarMatic: Explanation & Answer

Your ready answer from a verified tutor is just a click away for as little as $14.99


  

Click Order Now to get 100% Original Answer Customized to your instructions!

HOME TO CERTIFIED WRITERS

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing

Have a similar question?

PLAGIRAISM FREE PAPERS

All papers we provide are well-researched, properly formatted and cited.

TOP QUALITY

All papers we provide are well-researched, properly formatted and cited.

HIGHLY SECURED

All papers we provide are well-researched, properly formatted and cited.

ScholarMatic: Get Started

Assignment Writing Service

Feel safe and secure when placing an order on our portal!
Fruitful cooperation begins with solid guarantees, and we are professional enough to promise perfect results. Let’s get it started!