Question: Consider the class Computer: class Computer { public: Computer (int s, int mm, int hm ) ; void display_specs (ostream & out) const; int get_speed


Consider the class Computer: class Computer \{ public: 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) Derive a class Laptop from the class Computer. Provide only the interface for the class Iaptop. The class Laptop has an additional private member variable batteryTime. Include an accessor for the batteryTime. Redefine the display_specs () member function to include the battery time in the display of the specifications. (6) (b) Implement only the member function display_specs () for the class Iaptop. (3)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
