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

 Write a C++ program that will read in the quantities and

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

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!