Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

File I / O John is shopping at pizza Hot. He is ordering two large sausage pizzas, one large cheese pizza, drinks, and wings for

File I/O
John is shopping at pizza Hot. He is ordering two large sausage pizzas, one large cheese pizza, drinks, and wings for his birthday party.
He saves the unit prices and orders in a file named 'orders.txt'. The contents of the file are as follows: The sausage pizza costs $11.99 with 2 orders, a cheese pizza costs $9.99 with one order, drinks are priced at $2.55 with 10 orders, and wings cost $6.50 with 3 orders.
11.99,2,9.99,1,2.55,10,6.50,3
John pays $100 to the cashier and seeks your assistance in writing a C++ program to read the unit prices for pizza, coke, hotdog, and the corresponding orders from his file. With a sales tax of 2%, your program will calculate the total amount he needs to pay and the change he will receive.
The receipt will be generated and saved to a file named 'receipt.txt'. The output will display the total price of each item, the overall total, and the change, all rounded to two decimal places.
receipt.txt file:
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

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

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago