C++ Review Questions (7th ed.)
CMPT 125/128 with Brian Fraser
These are some suggested review questions from the course textbook: Starting Out with C++, Early Objects by Gaddis et. al, 7th Ed. These questions should help you assess how well you understand each topic; they are not meant to be samples of the exact type of questions that you will be asked on tests. In addition to these, you should also review the lab and assignment questions, plus lecture notes.
Checkpoint Questions: Many sections of the text end with Checkpoint questions. These are a good initial check of each section. You should try these after reading a section.
Up to Midterm
Chapter 2: Intro to C++
- Short Answer: 1, 2, 3, 4, 9, 10, 11, 12, 16.
- Algorithm Workbench: None
- Predict the Output: 25, 26.
- Find the Error: 27.
- Programming Challenges: 4, 5, 13, 15.
Chapter 3: Expressions
- Short Answer: 1, 4, 5, 8, 910, 11, 12, 13, 14, 15, 17, 18, 19, 20.
- Algorithm Workbench: None.
- Predict the Output: 25, 26. - Note that you will not be asked any questions which require a calculator on the exam.
- Find the Error: 27.
- Programming Challenges: 1, 2, 7, 8, 22.
Chapter 4: if & switch
- Short Answer: 1, 2, 3, 4, 6, 7, 8, 15, 16, 19, 22, 23, 24.
- Algorithm Workbench: 25, 27, 30, 31, 32, 33, 34.
- Find the Error: 35.
- Programming Challenges: 2, 5, 7, 9, 11, 16.
Chapter 5: Looping
- Short Answer: 3, 4, 9, 15, 16, 18, 19, 20.
- Algorithm Workbench: 23, 27, 28, 29, 30.
- Predict the Output: 31, 32, 33, 34.
- Find the Error: 36.
- Programming Challenges: 1, 6, 7, 12, 17.
Midterm to Final
Chapter 6: Functions
- Fill-in-the-Blank and Short Answer: 1, 2, 3, 6, 7, 8, 9, 13, 14, 15, 21, 23, 24, 26, 27, 29, 30, 31, 32.
- Algorithm Workbench: 33, 34, 35, 36, 37, 38.
- Find the Error: 39 (skip part C).
- Programming Challenges: 1, 3, 4, 5, 7, 8, 14.
Chapter 7: Classes & Objects
- Fill-in-the-blank and Short Answer: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 22, 24, 25, 28, 30, 31, 32, 33.
- Ambiguous question: #26. Quick facebook poll suggests answers may be "the polka", "Klingon translations", "the Macarena!", "drugs. Just say no.", "anything friendly"....
- Algorithm Workbench: none.
- Find the Error: 52, 53, 54, 55.
- Programming Challenges: 9, 11, 12, 14 (no default tax rate).
Chapter 8: Arrays
- Fill-in-the-blank and Short Answer: 1, 2, 4, 6, 7, 8, 9, 12, 13, 14, 21, 22, 23, 24, 25, 28, 29, 30.
- Algorithm Workbench: 31, 32, 33.
- Find the Error: 37, 38, 39.a only.
- Programming Challenges: 1, 2, 3, 6, 8, 9, 12, 13.
Chapter 9: Sorting & Searching
- Fill-in-the-blank and Short Answer: 1, 2, 3, 4, 5, 6, 7, 8, 14, 16.
- Programming Challenges: 1, 2, 3, 6, 7, 8, 9 (using insertion sort instead of bubble sort).