Before the checkout customer can remove any item from the cart at any time.

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%

Instruction:please do not use advanced c++ for this scenario just use double linked list in c++

You are required to implement a shopping cart module for an online shopping mall. From the available items a
user will select the item to purchase and add this into his shopping cart. Before the checkout customer can
remove any item from the cart at any time.
A single item in the cart contains the following details:
class Item
{
private:
int itemID;
string itemName;
double price;
double purchasedQuantity;
double totalPrice;
public:
//constructors and getter setters
};
For the implementation of the required module you have to meet the following requirements:
1- Customer can add any item to the cart in desired quantity.
Remember if customer added the same item in the cart again, your implementation will not add this as a new
item it will check if the item already exists than it will just add the new quantity in the previous and update
other data.
2- Customer can remove item or change the quantity at any time.
There are two possibilities:
i. Customer wants to remove the item form the cart
ii. Customer wants to change the quantity of item in the cart

3- Customer can also view his cart at any time. You have to provide two features for the user in order
to view his cart:
i. View cart: it will display all the items that customer selected to purchase.
ii. View cart by items: Display one item and facilitate user to navigate through next or
previous item in the cart till the user wants to quit the view.

4- Customer can calculate his bill. Bill will be calculated according to the item price and the number
of items he wants to purchase.
5- Bill should be displayed in user friendly manner to the customer.
You have to provide implementation of following methods for the Cart class.
 addToCart( int itemID,string itemName,double price, int purchasedQuantity);
 addExistingToCart(int itemID, int quantityToAdd);
 removeFromCart(item itemToRemove);
 void changeQuantity : (int itemID, int newQuantity);
 calculateBill();
 printBill();
 viewCartByItem();
 viewCart();

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Probability Problems
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