Test 3 CSCI 130 Summer 2004

  1. (8 points) Describe at least four ways procedures make programming easier.
  2. (10 points) Give an outline of a C++ program which demonstrates each. (Label each in your example)
  3. ( 2 points) What is a parameter?
  4. ( 10 points) Describe and give examples of three ways the actual parameter list must match the formal parameter list. Show an example that does not meet each of the three conditions. Label the problem with each example.
  5. (5 points) Describe the scope rules for resolving variable references in C++.
  6. (5 points) Give an example of and describe when you would use a parameter that is passed by reference and one that is passed by value.
  7. (5 points) Write a function which has three integers as input and returns the floating point average of these three numbers.
  8. (10 points) Write a function which takes a string and a character and removes all instances of that character from the string.