cs304 assignment no 3 solution and discussion
CS304- Object Oriented Programming
CS304 Assignment No. 03
SEMESTER Spring 2018
Consider yourself working as a software engineer in a marketing company of both hardware and software. The IT manager has given you a task to model a part of their simple advertising system. In this system, there will be four classes named Item, Sales, hwItem (Hardware Item), swItem (Software Item)
Steps to follow:
- Create a base class Item that should store the title of the item (a string) and its price (a float).
- Then create another base class called Sales which should contain an array of three floats so that it can record the sale in rupees of a particular item for the last three months.
- After that derive two classes hwItem (hardware item) and swItem (software item) from both Item and Sales The hwItem class should hold category of the item and its original manufacturer (om), whereas the swItem class should contain the type of the software and the Operating System (os) under which it works.
- Each class should have its own getData() and displayData() functions to input and output data respectively.