Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q 4 ) Write a C + + program that implements a shopping cart. User can login as Admin or customer. Admin can add new

Q4)
Write a C++ program that implements a shopping cart. User can login as Admin or customer. Admin can add new products, update the name and price of old products. A product Class has 3 attributes product ID (PID), product name and price. All products will be saved in a file "product.txt" in following form
product.bxt
50
\table[[PID,Product_name,Price],[P1,Board_marker,40],[P2,Ink,70],[P3,High_Lighter,60],[P4,Paper-Clip,120]]
Do not allow duplicate Product ID.
For customers, The program should display the catalog to the customers from "product.txt". The program should aceept PII) and required quantity of product until user enters 'B' and display all products and total bill and save this in a file "bill.txt"
Console Output:
PID Product_name
P1 Board_marker
P2 Ink
P3 High_Lighter
P4 Paper-Clip
Enter product ID and quantity
Press B to calculate bill
P21
P12
B
Your Bill is:
\table[[PID,Quantity,Price,Total],[P2,1,70,70],[P1,2,40,80]]
Total Bill is: 150
Make sure that you use concepts till Object oriented programming excluding vectors
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

Write an elaborate note on marketing environment.

Answered: 1 week ago