This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Lab 5 for CS101 Objective : Arrays This Java lab project addresses the ability to work with single and multi-dimensional arrays in Java. In this lab project, we consider how we can create arrays, index elements of arrays, set elements of arrays, pass arrays across method calls and return arrays as results of method calls. Code segments involving these operations are described in detail below as a list of methods to be developed. Unless otherwise specified, the numbers in any array of this lab shall be randomly generated. Implement the following four methods: indexOfLargestNumber : This method takes an array of numbers as input and returns the index of the largest number in that array. If the largest number appears multiple times, ties are settled by returning the index of its first appearance. For instance, given [4, 2, 7, 1, 7, 3] as input, the method returns 2 (the index of the first appearance of 7 in the array). The method shall print out the values in the input array for verification. The following is the method prototype for the method:...
View Full Document
This note was uploaded on 04/29/2008 for the course CS 101L taught by Professor Vineyard during the Fall '07 term at Kettering.
- Fall '07