Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ Imagine you are shopping. Add item to your shopping cart display the added items and the total of all items. Write a CH program

c++ image text in transcribed
image text in transcribed
image text in transcribed
Imagine you are shopping. Add item to your shopping cart display the added items and the total of all items. Write a CH program that reads ten item name and item price from the user, using a counter controlled while loop. The program displays the item name and price entered for each item. The program displays the total of all items purchased. The program output is formatted. Note: Must use while loop. Sample Output Enter name of item 1: apple Enter item price: 2.00 Item apple added to cart Price $2.00 Enter name of item 2: lime Enter item price: 0.25 Item lime added to cart. Price $0.25 Enter name of item 3: mango Enter item price: 2.50 Item mango added to cart. Price $2.50 Enter name of item 4: milk Enter item price: 4.00 Item milk added to cart. Price $4.00 Enter name of item 5: juice Enter item price: 3.00 Item juice added to cart. Price $3.00 Enter name of item 6 chips Enter item price: 2.00 Item chips added to cart Price $2.00 Enter name of item 7: bread Enter item price: 3.00 Item bread added to cart. Price $3.00 Enter name of item 8: cookie Enter item price: 4.00 Item cookie added to cart. Price $4.00 Enter name of item 9: butter Enter item price: 4.50 Item butter added to cart. Price $4.50 Enter name of item 10: eggs Enter item price: 2.00 Item eggs added to cart. Price $2.00 Total Price: $27.25 Grading Criteria: You will receive 0 points if.cpp file is not submitted, You will receive only 3 points if program doesn't compile, You will receive 5 points when while loop is not used but you get the expected output. You will receive 7 points- while loop is used and the program displays the correct total of all items purchased. You will receive 9 points while loop is used and the program displays: (i) the item name and price entered for each item and (11) the correct total of all items purchased You will receive 10 points-while loop is used and the program displays: (1) the item name and price entered for each item, (11) the correct total of all items purchased, (iii) program output is formatted

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions