Docsity

Introduction Computer Programming - Lab 7 - Fall 2005 | CSC 3405, Lab Reports of Computer Science

Toggle sidebar
bg1
Lab 7
CSC3405/3605
Name:
Due Date: Monday, 3/30/2009
Part 1:
Part 2:
Part 3:
a). Write a function which is passed an integer, searchValue, and an array, and
counts the number of elements in that 10 element array that are equal to the
search value. I’ll start it for you:
static int howManyMatch (int [] list, int searchValue)
{
int numMatch = 0;
return numMatch;
}
b). How would you call this function from the main program, supposing you
wanted to know how many 2’s were in the array? Write a driver to test your
searchValue method.

Partial preview of the text

Download Introduction Computer Programming - Lab 7 - Fall 2005 | CSC 3405 and more Lab Reports Computer Science in PDF only on Docsity!

Lab 7

CSC3405/

Name:

Due Date : Monday, 3/30/ Part 1: Part 2: Part 3: a). Write a function which is passed an integer, searchValue, and an array, and counts the number of elements in that 10 element array that are equal to the search value. I’ll start it for you: static int howManyMatch (int [] list, int searchValue) { int numMatch = 0; return numMatch; } b). How would you call this function from the main program, supposing you wanted to know how many 2’s were in the array? Write a driver to test your searchValue method.