From a sales CSV, compute revenue=qty*price per product and print top 3.
CSV header: `date,product,qty,price`. Compute `revenue = qty * price` summed per product.
Print the **top 3** products as `product:revenue` (revenue formatted with 2 decimal places), sorted by revenue **descending**, ties by product name ascending.
Test input:
date,product,qty,price
2024-01-01,apple,3,1.5
2024-01-02,banana,10,0.5
2024-01-03,apple,2,1.5
2024-01-04,cherry,5,4
2024-01-05,date,1,3
2024-01-06,banana,4,0.5
Expected output:
cherry:20.00
apple:7.50
banana:7.00
Sign in to save your code and track progress across devices.