Tuesday, October 25, 2011

Homework 8 - GSCookieOrders.java

Girl Scouts sell their signature cookies once a year. Each scout receives an order form and badgers everyone they know sells cookies. When order forms are collected by the Cookie Coordinator, she adds up all the individual box counts and places the troop order with the local council. The council only sells full cases of cookies so the Cookie Coordinator must round up the order if the troop has not sold an exact order of cases.

Write a program that accepts as its input the number of boxes of cookies sold by each scout (a scout might sell zero boxes). The program should have one method that accepts the input and returns the sum of the individual orders. A second method should determine how many cases the Cookie Coordinator needs to order. Terminate input with the sentinel value -1.

A case of cookies holds 12 boxes.

The class name must be GSCookieOrders and it must be written as a console application. Your methods must have the following signatures:

   public static int getOrders()

and

   public static int calculateCases(int boxes)

Sample Output
Here is a screenshot of GSCookieOrder's results.

GS cookie order output


Due Date:
Monday,November 7th, 8:00am