Exercise – Item Class:
Create a class Item with the following private attributes:
Item ID: should be an integer attribute.
Item Name: should be a character array attribute of size 20.
Item Cost: should be a floating-point attribute.
Item Price: should be a floating-point attribute.
The class Item should contain the following behaviors:
A constructor with three arguments (ID, Name, and Cost) should initialize the attributes to the parameters passed by calling the set all function.
A destructor should print the Item Name attribute plus the phrase “has been removed.”
A set all function that calls the attributes’ set functions.
Set functions for each attribute except for Item Price.
Get functions for each attribute.
A print function to display the values of the object’s attributes.
A utility function that calculates the Item Price attribute based on the Item Cost value. If the cost was less than 1000, then the price is equal to the cost plus 10%, else the price is equal to the cost plus 20%. This function must be called when the cost is changed.
A header file and source file must be created for class Item.
Another source file must be created for the main function:
Allow the user to input information (ID, Name and Cost) for two Item objects and pass them to the constructor.
Create a reference object for the 1st object and a pointer object to the 2nd object.
Call the print function through the reference and pointer objects.
Print on the screen the sentence “Destroying two objects:”.
Remark: When the user input the item name, cin.ignore() and cin.getline(name, length) functions must be used to receive the input correctly.
Output should be like this :
http://prntscr.com/21tp8u
i need this for today i hope anyone can give me a breif solution or if someone has the abilities to do it thanks a lot