{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# lab14g - Sample Output[3 3 3 3 3 9 4 4 4 5 5 5 5 6 6 7 7 7...

This preview shows page 1. Sign up to view the full content.

Lab Goal : The lab was designed to teach you how to use arrays to simplify solving more complex problems. Lab Description : Given a provided array, determine how many groups of a specified size exist. For the array [1,1,1,2,2,2,3,3,3,4,5,6,7] , there are 7 groups with at least one, 3 groups with at least 2, and 3 groups with at least 3. A group is a series of same values. 1 1 1 is a group of 3, but it also is a group of 1 and 2. To count as a group, all values must be the same. 1 1 1 is a group of 3 because there are 3 1s in a row. Sample Data : 3 3 3 3 3 9 4 4 4 5 5 5 5 6 6 7 7 7 8 8 8 8 8 8 8 8 1 2 3 4 5 6 7 8 9 1 1 1 2 1 1 3 3 3 3 3 3 3 3 3 3 4 4 4 5 4 4 4 6
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Sample Output : [3, 3, 3, 3, 3, 9, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8] size 1 count == 7 size 2 count == 6 size 3 count == 5 size 4 count == 3 size 5 count == 2 size 12 count == 1 [1, 2, 3, 4, 5, 6, 7, 8, 9] size 1 count == 9 size 2 count == 0 size 3 count == 0 size 4 count == 0 [1, 1, 1, 2, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 5, 4, 4, 4, 6] size 1 count == 8 size 2 count == 5 size 3 count == 1 size 4 count == 1 © A+ Computer Science – Arrays - www.apluscompsci.com Computer Science I Lab 14G – GROUP COUNTER Lab Value - 120 Files Needed :: ArrayStats.java Lab14g.java...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online