Question: Write a C++ program to read the data from an ASCII file (text file), which has the inveatory data for a store. Use only windows

 Write a C++ program to read the data from an ASCII

Write a C++ program to read the data from an ASCII file (text file), which has the inveatory data for a store. Use only windows notepad to create this file, otherwise there may be extra characters in the file. The file has the data written to file in the following sequence for each part in the inventory Part name (one word only), number of units in inventory (Integer data), unit price (floating point data). The sample lines from the file looks like the Figure 1 below. Exp3.txt - Notepad Chisel 58 9.99 Bolts 208 2.99 Hanner 30 15.99 Nuts 300 1.99 Nails 2000 0.99 Soap 55 1.89 FIG 1 This structure of file will allow you to use only extraction operator>> to read all data. Read the data from file and calculate the value of inventory first for each item. For example for Chisel it would be 50*9.99 - 499.50 Then sum up the values for all items in the file to find Total cost of the inventory in Then output the data into an output file where it is formatted in a Table form that looks like the Figure 2 below: dollars. Inventory Report For Jane Doe International Hardware ITEM NUMBER OF UNITS UNIT COST (5) TOTAL VALUE(S) Chisel 50 9.99 499.50 Inventory Total (S) 2000.45 Perfect alignment is required. The names of parts must all be left Justified, so that first letter of each part name aligns in the same vertical line. All numbers must be right justified, so that last digit of each line in each column aligns in the same vertical line. Numbers must be centered in each column. The inventory total must be aligned as shown in the Figure 2 above. For those float number, where price or total value rounds off to whole dollar, the price must be printed such as 12.00, not 12

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!