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.
- Why are functions used in C++ programming?
- What is a parameter?
- What is a return value?
- How many data items can be sent back to the calling function using a
return statement?
- What is the purpose of a function prototype?
- Give an example of a function prototype?
- What is a function definition?
- Give an example of a function definition.
- What is a function call?
- Give an example of a function call.
- Write the function prototype, function definition and give an example of a
function call for a function that computes the area of a circle.
- What is the difference between passing by value and passing by reference?
- What is a reference?
- How do you create a function that creates multiple values?
- 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.
- What is function overloading and what is it used for?
- What is a function's signature?
- What are some uses for function templates?
- How are recursive functions different from non-recursive functions?
- What is meant by the "scope" of a variable?
- How do you determine the scope of a local variable?
- What is the scope of a global variable?
- How do you declare a variable to have global scope?
- List the four variable storage classes.
- What is the default storage class in C++?
- What is the difference between the auto storage class and the static
storage class?
- How might a static variable be used in C++?