posted 10 years ago
I'm having some trouble developing this program. We are supposed to enter the type of cookie, the number of boxes, and the cost per box. We then print each cookie, it's price, the number we order and the total cost. Then we print the total number of boxes for all cookies and the total cost of all cookie. We must accumulate these totals as stated in line 12 of the driver and have methods to calculate these totals. I am unsure of how to write these methods. I know that for calcBoxes, I must get the number of cookies for a certain type and add that to the total. For calcCookieCost I must get the number of boxes from caclBoxes and multiply this by the price per box. For right now, I'm multiplying by 1 to avoid red Xs while I figure this out. When I run this program, I get an exception, but I don't know why I am receiving one.