CS 102 Lab #4

In the homework you are required to use some functions that provide a certain interface. In this lab, you will be defining a function that provides a specific interface.

Write a function called identify, that provides the following interface:

void identify(/* in */ int number, /* out */ int& type)
The function must set type to the value 0-4, as specified below.

If the number isSet type to
1,2,5,91Note: Normally we would perform such an operation with a function that takes a single in parameter and returns a value for the type. You have to do it this way for this lab, because learning to use reference parameters is part of the exercise.
4,11,13,162
3,6,7,143
8,10,12,154
anything else0

A file lab4-main.o has been provided in the directory ~cs102/public_html You must implement your function (with precisely the interface described above) and link it with this object file, which includes a main that calls your function. For example, if your implementation of identify is in the file lab4.C, you would type:

% g++ lab4-main.o lab4.C
To compile your program. The main program provided will, provided your function works, prompt you for numbers and, after you enter a 0, will output how many of each of the types were entered.