You run a store and want to know where you make the most money and which items sell the most. You have a list of your items, how many times each has sold and how much profit you make each sale. Each item name is a single word. The total profit on an item is the number of sales times the profit of the item. Write a program that will take in this data and produce a sorted list using the following rules:
Sorting Rules:
There will be an unknown number of inputs that consist of the triple itemName numberOfSales profitEachSale, with each triple on its own line, and each value on a line is separated by a single space. The itemName is a single word and the format for each input line will be:
itemName numberOfSales profitEachSale
Display the sorted list, with each item on its own line. The format for displaying the item will be:
$totalProfit – itemName/numberOfSales
There is a single space before and after the dash, and the profit value must have exactly two decimal places.