
Name (printed):
Student ID #:
Section # (or TA’s:
name and time)
CMSC 106 Quiz #8 Fall 2007
Write the code as requested - you may assume there is a # defined constant named SIZE that holds the
value refered to and you may assume that one section of code you write can be used by other sections.
1. [8 pts.] Write a function that takes an array of size SIZE through the parameter then requests and
reads the integers typed until either the array is filled or the user enters a 0. The number of values
typed before the 0 or until the array was filled should also be passed back to the function who called
this one through a parameter. The return value of the function will be 0 if the arrray is completely
full or it will return a 1 if there is one or more empty slots in the array.
2. [8 pts.] Write a function that takes in an integer array of size SIZE that is already filled with some
values. It also takes an integer parameter to tell how many of the array elements are filled (they are
filled from the beginning of the array to that point). It then returns both the average and the highest
value (the two things people ask about exam scores).