Question: can you fix my code void marketdatabase (vectorf string arcode; int gnount; double price; string itemname; cout Enter product QR, name, and price (enter 'END'

can you fix my code  can you fix my code void marketdatabase (vectorf string arcode; int
gnount; double price; string itemname; cout "Enter product QR, name, and price
(enter 'END' to finish): " ; string line; while (true) \& getline(cin,
line); if (line = "END") break; itemname =1 ine. substx (1ine.find(' ')
+1,1 ine.find('\$') -1 ine.find(' ') - 1); price =stod(1 ine.substr (1 ine.find
( 's' )+1)); qreodes,push_back(qrcode); itens .push_back (itemname); prices.push back(price); ) int finderCodoIndex(const
vectorf for (size ti=0;i(i); \} ) return -1 : BD 4 )
(8) 11 Une: 54 Col: 27 Execption =( vold ) Oxi 18ec3a2ce
1ibor+abi: terminating due to uneaught exeeption of type std:tinvalid_ergunenti stois no conversion
void shoppinglist (const vector shoppinglistkodlarz; vector shoppinglistadetier; cout "Enter Shopping List (QR,

void marketdatabase (vectorf string arcode; int gnount; double price; string itemname; cout "Enter product QR, name, and price (enter 'END' to finish): " ; string line; while (true) \& getline(cin, line); if (line = "END") break; itemname =1 ine. substx (1ine.find(' ') +1,1 ine.find('\$') -1 ine.find(' ') - 1); price =stod(1 ine.substr (1 ine.find ( 's' )+1)); qreodes,push_back(qrcode); itens .push_back (itemname); prices.push back(price); ) int finderCodoIndex(const vectorf for (size ti=0;i(i); \} ) return -1 : BD 4 ) (8) 11 Une: 54 Col: 27 Execption =( vold ) Oxi 18ec3a2ce 1ibor+abi: terminating due to uneaught exeeption of type std:tinvalid_ergunenti stois no conversion void shoppinglist (const vector shoppinglistkodlarz; vector shoppinglistadetier; cout "Enter Shopping List (QR, Quantity) or 'END' to finish:In"1 whilo (true) t getline(cin, 1ine); if (fine = "END") break; r int amounta sto (1 ine, substr (iine, find (' ' )+1) ); int indox = findercodoIndox(qreodes, qreode); if (index t=1 ) t shoppingliatkodlar, push_back(qreodo); shoppinglistadotler,push_bsok(amount); ) else t cout "Invelid QR codo. Please onter a valid CR code. In"; 3 ) double subtotal =0.0; cout \& fixed; cout "Iten Name * Quantity Total Pxicela"; for (size_t 1=0;1 to use setw. Note that you should \#include to use setw. Setting Decimal Precision for Prices: - To ensure that all prices are displayed with two decimal places, use 'fixed' and 'setprecision(2)'. - Place cout

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 Databases Questions!