Determining Total Revenue and Total Cost