1. Write a function match which takes 2 integer arrays (named one and two) and returns the number of times "matches" occur in parallel positions in the two arrays. That is, count the number of times one[i] == two[i]. The size of both arrays is the same. The arrays are passed as parameters along with their size. 2. Write a prototype for your function in question 1. 3. Write the statements to declare two arrays of size 25, read values into the arrays, call your match function, and print out the number of matches in the two arrays. 4. Write a function named count that will count and return the occurrences of a given character in an array named letters. The parameters will be the array letters, the size of the array, and the character to count. For example: If the array contained the values x 8 R A a a 0 s S a A and the character to count was 'a', then the function would return 3. 5. Write a prototype for the function in the previous problem. 6. Write the statements to declare an array of characters, and initialize the array to contain the characters: f A i @ N Z a 7 p Y h A. Call the count function and print the number of times the character p is contained in the array. 7. Write a function called search that receives an array of ints, the size of the array, and a number to search for. The function will return true if the number is contained in the array, and will return false otherwise. 8. Write a prototype for your search function. 9. Write the statements to call your function to search for the value 1500 in an array called salaries which has 100 elements. Print a message telling whether the value was found in the array.
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2002