Madam Phoenix hasn't had much luck with her numerology business, so she is moving to the southwest to open a Fun In The Sun store selling sunglasses, sunscreen, and similar items. She has hired you to write an inventory program for the new store.
Each activity your program must process appears as a separate line of input. Every activity line begins with a lowercase keyword identifying the action to perform. Item names are case sensitive and contain no more than ten non-blank characters. All fields on an activity line are separated by blanks, and you may assume the input contains no errors.
The activity lines your program must process are:
new item-name item-cost item-selling-price
item-cost and item-selling-price are given as ordinary dollar amounts without the dollar sign: one or more digits, a decimal point, and exactly two more digits. This activity does not by itself change the inventory; it prepares for later stocking of the item. item-cost is what Madam Phoenix pays for each unit, and item-selling-price is the price at which she sells it. At most 100 distinct item names ever appear, and neither item-cost nor item-selling-price exceeds 100.00.delete item-name
buy item-name quantity
quantity units of the item (at the previously given cost). A single purchase is never larger than 5000 units, but the number of units in inventory may grow as large as 10,000.sell item-name quantity
quantity units of the item are sold (at the previously given selling price). The quantity sold never exceeds the number of units in stock.report
new and not deleted), print, in columns with suitable headings, the item name, the buying price, the selling price, the number of units in inventory, and the value of those units (units in inventory * buying price). Items with zero units on hand are still listed. Report lines are sorted by item name in ascending order of character codes (ASCII). After the last item, print the total value of all units in inventory, and then the total profit since the last report. Profit equals total sales, minus the cost of the items sold, minus the cost of the items written off by delete. Every amount must be exact.Each activity is given on its own line. The end of the input is marked by a line with an asterisk (*) in the first column; no other activity line begins that way.
For every report activity, print a report in exactly the format shown in the sample cases: a centered INVENTORY REPORT heading, a column header and its underline, one line per item (sorted by name), a separator line, the total value of the inventory, and the profit since the previous report. Numbers are right-aligned in fixed-width columns; profit may be negative. When more than one report is produced, print a single blank line between consecutive reports.