e02 : Midterm exam - II
num | ready? | description | exam date |
---|---|---|---|
e02 | true | Midterm exam - II | Wed 05/13 11:00AM |
The midterm will be on Gradescope. It’s called “Midterm 2”—it’ll become available at 10:30am on May 13. It’s open book and open notes, and must be done individually.
The midterm will be a timed exam that you can take any time within a 24-hour period, starting at 10:30am on May 13. You’ll have 80 minutes to complete the exam after you start it (unless you’ve requested DSP accomodations, of course!)
Lawton will be available (via Zoom) from 11am–1pm on May 13 to answer any questions. See the office hours page for his Zoom link. TAs and/or Tutors will also be available during their office hours and on Piazza.
If you take the exam at a different time than the class time and ask a Piazza question about it, keep in mind that it may not be answered in time.
- The format of the exam will be similar to Midterm 1
Topics Covered
The emphasis is on files, pointers, references, arrays, structs, and pointers to basic/struct types.
- Lectures up to the exam
- Homeworks 1 to 6
- Labs 0 to 5
Study Guide
- Memory
- Basic model of memory (addressable bytes)
- Representing multi-byte data like ints, address of multi-byte variables
- Program layout in memory during runtime
- Interaction of programs with memory
- Data representation:
- Conversions between difference bases using positional encoding (hex decimal binary)
- Finding the range of values with fixed numbers of bits for unsigned representation
- Git:
- Basics of
git
from the command line - Adding files to a commit, commiting with a commit message, sending and retrieving information from the remote server, etc.
- Basics of
- Arrays:
- declaration
- initialization
- representation in memory
- accessng elements via index-based and range-based for loops
- passing arrays to functions
- tracing/writing code involving arrays and showing program dynamics via pointer diagrams
- Files:
- Reading/writing to files using
ifstream
/ofstream
- Appropriately checking for errors/end of file
- Reading/writing to files using
- Pointers:
- declaration, size of a pointer
- initialization to null value, initialization using the ‘&’ operator
- pointer diagrams showing relationship between pointer and pointee
- derefencing pointers using the ‘*’ operator
- assignment involving pointers: making two pointers point to the same object
- changing where a pointer points to
- tracing/writing code involving pointers and showing program dynamics via pointer diagrams
- References:
- Definition
- Assignment
- Call by reference
- Differences between pointers and references
- tracing/writing code involving references and showing program dynamics via pointer diagrams
- Structs:
- Defining a struct as a data type
- Declaring structs
- Accessing memory variables using the dot (.) operator
- Pointers to structure (declaration and initialization)
- References to structures
- Arrays of structs
- Passing structs to functions by value, address, and reference
- Passing arrays of structs to functions
- tracing/writing code involving structs, pointers, references to structs, and arrays of structs; and showing program dynamics via pointer diagrams
Homework solutions
Past exams
You may also refer to all the past exams. Please note that some questions on these exams may refer to labs that you have not completed so far. You will only be asked questions related to the labs you have completed. The past exams should however provide some information on the expected difficulty and approximate format of the exam. Please note that there may be differences in content as well.
- Spring’18 - midterm 1
- Spring’18 Midterm 1 solutions
- Spring’17 - midterm 2
- Spring’17 Midterm 2 solutions
- Spring’17 - midterm 1
- Spring’17 Midterm 1 solutions
- Winter’17 - midterm 1
- Winter’17 Midterm 1 solutions
- Winter’17 - midterm 2 (Ignore questions in Part 3)
- Winter’17 Midterm 2 solutions
- Prior to W17