The Final Exam will be given on Monday, December 12th in OCNR 115 at 1:45pm. You will have two hours and thirty minutes to complete the exam. The exam is comprehensive and will cover the introductory materials, Sprankle Chapters 1-8, and Gaddis Chapters 1-7. You may use a calculator.

There will be a true-false/multiple choice section of the exam. There will also be short answer questions on the exam that reflect the class discussions and labs over the course of the semester. A significant portion of the exam will include C++ coding problems based on the topics from Chapters 5-7 of Gaddis.

It would be advisable to review the material on the first two exams, as some problems might be repeated on the final.

Review Topics

Previous Exam Reviews

Gaddis, Chapter 5, Loops & Files

  • Understand the increment and decrement operators (prefix vs. postfix)
  • Understand and be able to use a while loop, do-while loop, and for loop, as well as common uses for each
  • Be able to identify the difference between pretest and posttest loops
  • Know the input validation routine to validate input using while loops
  • Be familiar with how to use a do-while loop in a program with menus
  • Be able to compute a running total
  • Know what header file you must include to work with files
  • Understand the three basic steps to using files in a C++ program (Cheat Sheet)
  • Be able to explain the difference between ifstream and ofstream
  • Be able to write statements to open, close, read from, or write to a file

Gaddis, Chapter 6, Functions

  • Understand how a function is defined and called, as well as the purpose/format of function prototypes
  • Be able to explain the difference between arguments and parameters
  • Understand the difference between passing by reference and passing by value, and be able to give examples of when each should be used
  • What is a void function? How is it different from a value-returning function?
  • Know how to use the return statement in void and value-returning functions
  • Be able to write the C++ code for basic void and value-returning functions
  • What is the difference between local and global variables? (Is it advisable to use global variables in your programs? Why or why not?)
  • What is scope and how does it relate to functions?

Gaddis, Chapter 7, Arrays

  • Know how to declare arrays of various data types, including parallel and 2D arrays
  • Know how to initialize and access array contents
  • Be able to describe the two most common errors when working with arrays in C++
  • Understand how to print, compare, and copy arrays, and which type of loop works best for working with arrays
  • Be able to pass an array to a function and return an array from a function. Are arrays passed "by value" or passed "by reference"?
  • Be able to interpret the code for C++ functions that print an array to the screen, sum the elements of an array, and find the average of an array