Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started