MT1 Info
This information is current as of October 8th 2024!
Overview and Process
MUST BE TAKEN IN PERSON / NO REMOTE EXAMS
- Time/Date: Thurs, October 17th at 7 PM Pacific Pacific
- Location: (Based on Last Name)
- SLH 200 A-Ga
- HAR 101 Ge-Lo
- SGM101 Lu-St
- SLH 102 Su-Wo
- THH 210 Wu-Z
- 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.
- Format: Handwritten on paper.
- Questions: Any questions about the content of the exam (clarification, etc.) should be asked discreetly by raising your hand) to avoid disrupting your neighbors.
- Policies:
- You are allowed (1) 8.5 inch x 11 inch HANDWRITTEN (double-sided) cheatsheet with your USC email address and name written in the top-left corner of the cheatsheet on BOTH sides. What is printed on your cheatsheet MUST be handwritten (directly on the sheet or on a tablet and then printed) and MAY NOT contain prints of slides, copy/pasted code from homeworks/projects, etc. You can handwrite code from a past assignment, but just cannot copy/paste print. 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 calculators, phones, or textbooks are allowed.
- You must request to use the restroom or leave the classroom for any reason and only 1 person will be allowed to leave at a time.
- You may not have headphones or earbuds in.
- With 15 minutes remaining, no one will be allowed to leave the classroom (no bathroom use or leaving if you are finished). If you finish, simply close exam paper and sit quietly. Do NOT work on anything else.
Topics
The following is the list of topics that you should be familiar with. Use it as a guide to help your studying.
Unit 1a
- data types (int, char, double, bool)
- variables, scope
- experssions (including integer division, modulo, etc.)
- casting
- basic input/output with
cin
andcout
- basic math functions
pow
,sqrt
,sin
,cos
,abs
, etc. rand()
andsrand()
functions andRAND_MAX
constant
Unit 1b
- comparison operations
if
,else
,else if
statements- Not covered: switch (case) statement, ternary
? :
operator
- Not covered: switch (case) statement, ternary
while
anddo..while
loopsfor
loopsbreak
andcontinue
statements
Unit 1c
- defining arrays
- using arrays as look-up tables
- character arrays / C-strings
- Basic function calls, prototypes, etc.
Unit 1d
- scope
- pass-by-value
- functions with array arguments (pass-by-reference)
- return types and
void
functions - need for prototypes
Unit 1e
- big-O notation and using it to perform simple classification of code runtime
- Compilation using
g++
, its options/flags and how to compile code with multiple files - Understanding of the need for prototypes and the use of header (
.h
) files
Unit 2a
- declaring pointer variables (
int *
) - referencing (
&
) and dereferencing (*
) - pointer arithmetic
- C strings (null-terminated character arrays)
- Built-in functions:
strlen
,strcpy
,strncpy
,strcmp
Unit 2b
- Concept of dynamic memory allocation and when to use it
- Syntax of using
new
anddelete
both with scalars (individual variables) and arrays
Unit 2c
- pointers to pointers
- arrays of pointers (like char* argv[])
- command line arguments (
argc
andargv[]
)
Unit 2d
- Shallow vs. deep copy
- 2D array allocation via many 1D allocations
Unit 3a
- Structs
- C++ strings
Unit 3b
- Objects (classes) and object oriented programming
Practice
Here are some practice exams. Note that the topics they cover might be slightly different from our list of topics (below).
- Practice Midterm given in Lab.
- Spring 2023 MT1 and Solutions
- Midterm Review Packet from Fall 2016-2018 [NO SOLUTIONS - Either run the code, crowdsource answers with fellow students, or come to office hours.]
- There are some duplicate questions that you can ignore.
- Q7 solution explanation
- CS 103 Sp15 Midterm and Solutions
- This was a 60 minute exam
- Ignore the questions related to the
draw
library.
- CS 103 Fa14 Midterm and Solutions
- This was a 90 minute exam
- Additional midterm review questions with no solutions.
- Video explanation of Q4 of Gradescope Sample MT1