Question: Write a C++ program to read the data from an ASCII Aile (text ille), which Ras the inventory data for a store. Use only windows

Write a C++ program to read the data from an ASCII Aile (text ille), which Ras the inventory 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 (loating point data. The sample lines from the Mile looks like the Figure 1 below, Exp3 , txt - Notepad if ti chisel 50 9.99 Hanner 38 15.99 Nails 2838 3.99 Bolts 200 2.99 Nuts 300 1.99 Soap 55 1.89 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 dollars. Then output the data into an output file where it is formatted in a Table form that looks like the Figure 2 below: Inventory Report For Jane Doe International Hardware ........................... ITEM NUMBER OF UNITS UNIT COST (S) 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 lineNumbers must be centered in each column. The inventory total must be aligned as shown in the Figure 2 above. For those float numbers, where price or a total value rounds off to whole dollar, Ike price must be printed such as 12.00, not 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
