Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

Students also viewed these Databases questions