Hi, can someone please tell me if my solution to this question is correct: A camera retail shop requires a software to store information about cameras. The shop has two types of cameras: digital and analog. Suppose the shop owner needs to store information only about price, resolution and brand name. He also needs to print the storage format of cameras. System should be able to print the storage format even when other properties of cameras are missing or unupdated. [Hint: create a method for format instead of property] Storage formats cannot be generalized because digital camera stores photos in digital chip while analog camera stores photos in photo reel. Each type of camera MUST specify its storage format by printing storage description on screen like “storage format for analog camera is photo reel”. Create inheritance hierarchical structure for above scenario. Write the class definition with implementation of all the classes you have used above. Keep all the class members public for simplicity. Code: [COLOR=Blue]class camera { public: camera(); ~camera(); virtual void determine_format(); virtual void print_details(); }; class d_cam:public camera { public: dig_cam(); ~d_cam(); float price; string resolution; string brand_name; [/COLOR][COLOR=Blue]virtual void determine_format(); virtual void print_details(); }; class analog_cam:public camera { public: analog_cam(); ~analog_cam(); float price; string resolution; string brand_name; [/COLOR][COLOR=Blue]virtual void determine_format(); virtual void print_details(); }; Is this correct? [/COLOR]
Oops! Sorry guys; it should be: class d_cam: public camera { and class analog_cam: public camera { Sorry again.