Final Exam Review

The final exam is comprehensive so review the old exams.  I have included some review questions here for the new material on functions.

  1. Why are functions used in C++ programming?
  2. What is a parameter?
  3. What is a return value?
  4. How many data items can be sent back to the calling function using a return statement?
  5. What is the purpose of a function prototype? 
  6. Give an example of a function prototype?
  7. What is a function definition?
  8. Give an example of a function definition.
  9. What is a function call?
  10. Give an example of a function call.
  11. Write the function prototype, function definition and give an example of a function call for a function that computes the area of a circle.
  12. What is the difference between passing by value and passing by reference?
  13. What is a reference?
  14. How do you create a function that creates multiple values?
  15. Provide an example a function that returns no values, one that returns one value and a function that returns several values.  Your answers to this question should include the actual code for the function definitions.
  16. What is function overloading and what is it used for?
  17. What is a function's signature?
  18. What are some uses for function templates?
  19. How are recursive functions different from non-recursive functions?
  20. What is meant by the "scope" of a variable?
  21. How do you determine the scope of a local variable?
  22. What is the scope of a global variable?
  23. How do you declare a variable to have global scope?
  24.  List the four variable storage classes.
  25. What is the default storage class in C++?
  26. What is the difference between the auto storage class and the static storage class?
  27. How might a static variable be used in C++?