Task  Online Shopping System Using classes and arrays, the team will develop a set of functions for an online  shopping system. The system is represented by the following structure: 1- Class Item having the following private attributes: (ID, name, quantity, price) and  the following public methods: - Constructors (default, parameterized, and copy) - Setters & Getters - Operator overloading for the ==, +=,-=, >> and << operators Note that the ID member variable is not entered or read from the user. It is  automatically set by the class as a serial ID starting with the first item of ID 1 and  incrementing 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. The  class has the following public methods: - Constructor (parameterized) - Operator overloading for the >> and << operators - 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’s  quantity by the quantity of the parameter item using the (+=) in Item class,  and the price of the parameter object will be ignored. Use the == operator  for 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 successful  addition of item, which will succeed if there is a place in the array and fail  otherwise. - 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 Using  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 was  found, false otherwise. - Print Items. - This will print all the item information for the seller. - You will print each item using the (<<) operator. - Find an Item by ID - This returns an Item object (or a pointer to Item) with the specified ID if  there is an item with such ID.  - Destructor 3- In the main function,  ● First you’ll ask the seller to input his details using the (>>) operator in Seller class. ● Then you’ll ask him for his store capacity (maxNumberOfItems). ● Then you will show him a menu to choose from which have the following  options: 1. Print My Info.  a. This will print the seller info using the (<<) operator in Seller class. 2. Add An Item. 3. Sell An Item. 4. Print Items. 5. Find an Item by ID 6. Exit

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Task 
Online Shopping System
Using classes and arrays, the team will develop a set of functions for an online 
shopping system. The system is represented by the following structure:


1- Class Item having the following private attributes: (ID, name, quantity, price) and 
the following public methods:
- Constructors (default, parameterized, and copy)
- Setters & Getters
- Operator overloading for the ==, +=,-=, >> and << operators
Note that the ID member variable is not entered or read from the user. It is 
automatically set by the class as a serial ID starting with the first item of ID 1 and 
incrementing 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. The 
class has the following public methods:
- Constructor (parameterized)
- Operator overloading for the >> and << operators
- 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’s 
quantity by the quantity of the parameter item using the (+=) in Item class, 
and the price of the parameter object will be ignored. Use the == operator 
for 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 successful 
addition of item, which will succeed if there is a place in the array and fail 
otherwise.
- 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 Using 
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 was 
found, false otherwise.
- Print Items.
- This will print all the item information for the seller.
- You will print each item using the (<<) operator.
- Find an Item by ID
- This returns an Item object (or a pointer to Item) with the specified ID if 
there is an item with such ID. 
- Destructor

3- In the main function, 
● First you’ll ask the seller to input his details using the (>>) operator in Seller
class.
● Then you’ll ask him for his store capacity (maxNumberOfItems).
● Then you will show him a menu to choose from which have the following 
options:
1. Print My Info. 
a. This will print the seller info using the (<<) operator in Seller class.
2. Add An Item.
3. Sell An Item.
4. Print Items.
5. Find an Item by ID
6. Exit

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education