Improvement on my initial code

Now it prints the cost of sales, gross profit, net profit and profit for
the period for each company.