# Lab14a - sum of spots 3-16 = 66 sum of spots 2-9 = 37 of 0s = 2 of 4s = 2 © A Computer Science – Arrays www.apluscompsci.com Computer Science I

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

Lab Goal : This lab was designed to teach you how to use an array. Lab Description : Write a method to sum up a section of a provided array and another method to count up how many of a certain number occur in the array. Sample Data : See below Sample Output : [4, 10, 0, 1, 7, 6, 5, 3, 2, 9] sum of spots 3-6 = 14 sum of spots 2-9 = 24 # of 4s = 1 # of 9s = 1 [4, 2, 3, 4, 6, 7, 8, 9, 0, 10, 0, 1, 7, 6, 5, 3, 2, 9, 9, 8, 7]
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: sum of spots 3-16 = 66 sum of spots 2-9 = 37 # of 0s = 2 # of 4s = 2 © A+ Computer Science – Arrays - www.apluscompsci.com Computer Science I Lab 14A – ARRAY FUN HOUSE Lab Value - 100 basic array code int array = {3,4,5,65,6,7,8,81}; for(int i=0; i<array.length; i++) { out.println(array[i]); } Files Needed :: ArrayFunHouse.java Lab14a.java...
View Full Document

## This note was uploaded on 01/24/2011 for the course COMP SCI 543 taught by Professor Mark during the Spring '10 term at Brown College.

Ask a homework question - tutors are online