Question: java Programming Problem 1 Girl Scout Cookie Sales A troop of Girl Scouts is selling boxes of cookies. The leader of the Girl Scout troop

java Programming Problem 1 Girl Scout Cookie Sales

A troop of Girl Scouts is selling boxes of cookies. The leader of the Girl Scout troop wants to know how many girl scouts sold boxes of cookies in the following ranges:

0 to 10 boxes

11 to 20 boxes

21 to 30 boxes

31 to 40 boxes

41 or more boxes

The program should use an array of counters to keep track of the number of Girl Scouts selling boxes of cookies in each of these ranges. The number of boxes sold for each Girl Scout will be entered at the keyboard. The total number of girls in the troop selling cookies will also be entered at the keyboard. After the total boxes for each girl in the troop has been entered, the resulting statistics for the number of boxes should be printed out to the console in the following format:

TOTAL BOXES

NUMBER OF GIRL SCOUTS

0 to 10

13

11 to 20

8

21 to 30

5

31 to 40

1

41 or more

1

Note that these values are just for formatting purposes. Your program needs to work for any number of girls in the troop and any number of boxes of cookies sold.

Directions:

Create a main method that will solve the previous problem statement.

You may only use statements that are discussed in the book through Chapter 6.

You must not use any Array class or Array method included in the Java libraries to solve this problem.

Use the following input values for the final test of this program:

Total number of girls in the troop 8

Boxes of cookies for girl #1 43

Boxes of cookies for girl #2 18

Boxes of cookies for girl #3 23

Boxes of cookies for girl #4 20

Boxes of cookies for girl #5 35

Boxes of cookies for girl #6 17

Boxes of cookies for girl #7 11

Boxes of cookies for girl #8 25

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!