Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that will read in the quantities and prices items from a file then calculates the total price (quantity * price) for

image text in transcribed

Write a C++ program that will read in the quantities and prices items from a file then calculates the total price (quantity * price) for each item and saves it in another file including the quantity and price. Last line includes the total for all items. Read the data from the file ItemsPrice.txt (included in the folder) Write the output to a file named TotalPrice.txt. Your program should check if the file exists before reading it. Sample Run: Input file: ItemPrice.txt (First number is quantity and second number is price) 104 20 3 100 5 Output file: TotalPrice.txt (First number is quantity, second number is price, and third is the total) 10 4.40 20 3 60 100 5 500 All 3 Items Total is $600

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions