Question: write the program in c++ A program is required to read a series of product sales records from an input file specified by the user.

write the program in c++

A program is required to read a series of product sales records from an input file specified by the user. Each line of the file contains an item name (CANNOT HAVE SPACES), quantity sold, cost of item, and price sold:

Item_name qty_sold cost price

Calculate and display the revenue and profit on each item, as well as the total revenue generated by all sales. Write this information to an output file. Your program should prompt for names for both the input and output file.

Here is a sample file to test with, but your program should work with any file that is in this format.

keyboard 20 54.95 75.00

mouse 10 22.50 30.00

output file with this input file

Product Revenue Profit

keyboard $1500.00 $401.00

mouse $300.00 $75.00

Totals $1800.00 $476.00

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!