Using classes and arrays, the team will develop a set of functions for an onlineshopping system. The system is represented by the following structure:1- Class Item having the following private attributes: (ID, name, quantity, price) andthe following public methods:- Constructors (default, parameterized, and copy)- Setters & Getters- Operator overloading for the ==, +=,-=, >> and <>
Note that the ID member variable is not entered or read from the user. It isautomatically set by the class as a serial ID starting with the first item of ID 1 andincrementing with every new object.2- Class Seller having the following private attributes: (name, email, items,maxItems),where items is a dynamic array of objects of type Item with the size maxItems. Theclass has the following public methods:- Constructor (parameterized)- Operator overloading for the insertion <>- Add An Item.- This will take an Item object as a parameter:- If the item already exists in the seller's items you will increase the item’squantity by the quantity of the parameter item using the (+=) in Item class,and the price of the parameter object will be ignored. Use the == operatorfor this where an item is equal to another if they have the same name.- Else you will add it to the seller’s items.- The member function should return a boolean that indicates the successfuladdition of item, which will succeed if there is a place in the array and failotherwise.- Sell An Item.- This will take an item name and a quantity as parameters- If the quantity is <= item’s="" quantity="" you="" will="" decrease="" it="" from="" item="">=>the (-=) in Item class.- Else you will print him “There is only {quantity} left for this item”.- The member function should return a boolean which is true if the item wasfound, false otherwise.- Print Items.- This will print all the item information for the seller.- You will print each item using the (<)>)>- Find an Item by ID- This returns an Item object (or a pointer to Item) with the specified ID ifthere is an item with such ID.- Destructor
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here