Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 5 Assume that a customer shops at an online store and adds the items they intend to buy to a cart. Write a program

image text in transcribed
Question 5 Assume that a customer shops at an online store and adds the items they intend to buy to a cart. Write a program that read the name of the products, the quantity of the products selected, and the price of one of those items from a file called cart.txt. The input file is as follows: Pens 3 2.99 Notebook 7 3.00 Shoes 2 15.49 The program should calculate the total cost of each item, the total cost of all items in the cart before taxes, and the final cost of all items after taxes. Assume the sales tax applied is 4.9%, Output the results to a file called receipts . txt. The output must be in the form shown below. == = Your receipt Item Count Price/Item Item Total Pens 3 $2. 99 $8 . 97 Notebook J $3.00 $21. 00 Pens N $2 . 99 $30 . 98 ReSEMBLE=2: Subtotal $60 . 95 JESSE= = Total $63. 94 Be sure to format the output accordingly (all dollar amounts should be to 2 decimal places). Your program should continue to work even if more items are added to the cart Attach File Browse Local Files Browse Content Collection

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

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Divide and rule ?

Answered: 1 week ago