Question: Write a C++ program for a smart shopping cart. Item data should be stored in three parallel ID arrays. The first contains the selected

Write a C++ program for a smart shopping cart. Item data should 

Write a C++ program for a smart shopping cart. Item data should be stored in three parallel ID arrays. The first contains the selected item barcode, second contains the total number of pieces (quantity) picked of the selected item and the third one contains the price for each item. i) Write a function, called read that reads the carts' item details. ii) Create the function TotalPrice that would calculate the total price of each item in the cart. iii) Create the function printItems that would print all the items stored in the parallel arrays in a tabular format. iv) Create the function findFavouriteltem that would return the barcode of the item bought in largest quantity. v) vi) Create the function findItemPriceByBarcode that would return the final price of the specified barcode item. If barcode does not exist, the function should return -1. In the main function, read the values of the parallel arrays using read, print the arrays in a tabular format using print.Items, and print the item bought in largest quantity using findFavouriteitem. vii) Also in the main, ask the user to enter a barcode, search for it using findItemPriceByBarcode, and if the item is found, display the total number of sold items; otherwise, display an error message. The output of your program might look similar to the example below (user input indicated in bold). Barcode Number of Pieces Price Total 24 40 20 10212 10213 10215 2 5 1 12 8 20 The barcode of your favourite item is: 10213 Enter the barcode for the total number of sales of the item> 10212 The total price of selected item 10212 is $24.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!