Final Info
Overview and Process
MUST BE TAKEN IN PERSON / NO REMOTE EXAMS
- Date/Time: Sat, December 14th at 11 AM Pacific - 120 minutes
- Location: (Based on Last Name)
- A-J: SAL 101
- K-Pl: SLH 200
- Po-Z: SGM 124
- OSAS Accommodations: If you have USC approved accommodations, you will need to coordinate in advance with the OSAS office to schedule your exam at the testing center.
- Bring: A pencil or two and an eraser. No laptop needed!.
- Format: Paper and PENCIL (preferred not a pen) exam with multiple choice or fill-in-the-blank answer style for all question types: conceptual, tracing, and coding.
- You MAY bring 8.5x11 inch cheatsheet, double sided.
- The contents of the cheat card must be HANDWRITTEN The reason is because by writing things, they will stick longer in your head and force you to recall what your code was doing, helping you learn.
- Other than the cheat sheet, the exam is Closed book, Closed notes, Closed Internet (search/reference). No other devices are allowed out during the exam.
- Questions: The test will mainly have questions that designed to have a small, closed-set of possible answers (i.e not open-ended) and are written to state the necessary information required to solve the problem. We cannot offer hints or additional details/guidance beyond what is stated in the exam. So, our answer could likely be: “The question is well-formed (no typos) and all the information you need to answer is provided. Do the best you can.” But, with that said, if you have a question you may raise your hand and a staff person will try to come to you. Please sit on the aisle if you tend to ask questions more often than your peers.
Topics
The following is the list of topics that you should be familiar with. Use it as a guide to help your studying.
The exam is cumulative (so the topics listed on mt1-info is still relevant), but will focus more on the topics covered after MT1.
Unit 3a
- Basic objects (structs)
- Assignment of objects
.
and->
operators- Use of
getline()
- Checking an input stream for failure
- Using C++
string
class
Unit 3b
- Defining your own classes
- public vs. private
- Constructors and Destructors and when they execute
- Defining member functions
- Splitting your class into files
Unit 4a
- Linked Lists
- Implementing basic operations (push, pop to front, middle, or back)
- Efficiency of various operations given variations of their implementation (with or without tail pointer, etc)
- Pros and cons compared to arrays
Unit 4b
vector<T>
anddeque<T>
basic operation- Efficiency of their operations
Unit 4c
- Doubly linked lists
deque<T>
class- Implementing basic operations
- Efficiency of various operations given variations of their implementation (with or without tail pointer, etc)
Unit 4d
- Multidimensional arrays
- Memory layout of a multidimensional arrays
- Passing multidimensional arrays to functions
Unit 4e
- syntax and use
- advantages of passing by reference
const
references
Unit 4f
- Checking for failure when opening a file
- Using C++
ifstream
andofstream
classes for File I/O - Checking for failure when attempting to receive input (extract a value from the stream)
Unit 5a - Operator Overloading
- Understanding the two approaches (Global vs. Member functions) and when to use each
- The signature of various operator overloads (arithmetic, comparison, etc.)
friend
functionsoperator<<
function signature and implementation
Unit 5b - Copy Semantics
- Copy constructors
- Assignment operators
- When each is called
- “Gotchas” that the assignment operator should handle
- Rule of 3
Unit 5c - Class Details
- Default vs. Initializing constructors
- Constructor Initialization Lists
const
keyword
Unit 5d - Inheritance
- Base class constructor and destructor calls
protected
keywordpublic
vs.private
inheritance- Composition vs. Inheritance
- Calling base class overloaded functions
Unit 5e - Polymorphism
- Static vs. Dynamic binding (
virtual
vs. non-virtual
) - pure virtual functions and abstract classes
- need for
virtual
destructors
Unit 5f - Parsing and Streams
operator>>
andgetline()
- When do input streams fail (
fail()
) - Correct approaches for how and when to check for failure
stringstream
s
Unit 5g - Exceptions
throw
keywordtry/catch
block- ordering of
catch
blocks - stack unwinding (exceptions propagating to calling functions)
- exceptions and inheritance
Unit 5h - File I/O Part 2
get()
andpeek()
seekg()
andtellg()
Unit 6a - Recursion
- Tracing of recursive functions
Topics from MT1 and the programming midterm are potential supporting material (you need to still basic syntax, loops, understand pointers, etc.)
Be sure you are very comfortable with:
- Pointers
- C-strings and pointers to C-strings. Arrays of char*’s (like argv[])
- Linked lists (single- and doubly-linked)
vector<>
anddeque<>
- Operator overloading (when to use global vs. class member functions, use of
friend
, etc.) - Deep copy semantics (copy constructor / assignment operator)
- Inheritance and Polymorphism
- Streams and parsing with
>>
andgetline()
, usingstringstream
s, and knowing when a stream will fail.
Practice Final on Gradescope
- Will be done in our last lab meeting.
- Gradescope Solutions
- Coding problems are on Codio and solutions are in that assignment.
Other Selected Practice Problems
Older Practice Problems
- Fall 2017 Final Exam
- No solutions / crowdsource your answer or come to office hours.
- Fall 2016 Final Exam
- No solutions / crowdsource your answer or come to office hours.
- Spring 2015 Final Exam
- Fall 2014 Final Exam
- Older Fall 2014 Practice Problems