MT1 Info
Overview and Proces
MUST BE TAKEN IN PERSON / NO REMOTE EXAMS
- Time/Date: Thurs, Feb. 22nd at 7 PM Pacific Pacific - 90 minutes (End at 8:30 p.m.).
- Location: (Based on Last Name)
- A-C: THH 301
- D-Ll (Lloyd): THH 201
- Lo-Q: THH 102
- R-Z: THH 101
- 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.
- Do not sit in the back row of each room or column closes to the wall as we need to be able to see your laptop screens for proctoring purposes.
- Do not angle your laptop screen toward the wall or use privacy screens. We must be able to see your screen reasonably well from the back of the room.
- Bring: A laptop or tablet with a minimum of 100 minutes battery run-time. Don’t count on outlet access.
- Format: we will likely pass out a paper version of the test with the question prompts. But you will enter your answers on Gradescope. Before the test begins, login into our Blackboard section, choose Assignmentments..Midterm 1 and click on the Gradescope link which will redirect you to Gradescope. You will then find a MT1 assignment (which will appear at the start of the exam) where you will be able to enter your answers to the questions. All answers need to be entered or uploaded to Gradescope, but you may use scratch paper to work out a problem. The majority of questions will be analysis, tracing, and conceptual. But 2 problems will involve coding.
- You may NOT use Codio for any of the tracing problems; ONLY the coding problems.
- For the coding problems, you MUST write your code in Codio. You MAY NOT use your own editor. Failure to follow this will result in a 0 on the exam. You can then compile and run it if you like, but we are not expecting you to do that and we will visually grade your code to assign points. Don’t waste time trying to compile/debug your code until you have finished the other problems. We will provide a blank Codio assignment with the skeleton files for you to work on. You can find a link to that assignment in Blackboard..Assignments..Midterm 1 after the exam begins. While it might be useful to compile, we don’t recommend running and debugging unless you have time.
- Questions: Any questions about the content of the exam (clarification, etc.) should be asked on EdStem (and not by raising your hand) to avoid disrupting your neighbors.
- Policies:
- You are allowed (1) 8.5x11 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). You may only access the following websites: Blackboard.com (to access the Gradescope or Codio links), Gradescope.com (to enter your non-coding answers), Codio.com (to perform the coding problems), and EdStem.com for asking questions. Other than that your mind and scratch paper are the only resources allowed.
- 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.
- Take care not to open the exam in 2 tabs / browsers or submit early. We can ONLY delete a submission if you click submit early and so you will need to start over again but will not be given additional time.
- If your laptop crashes, we will have a limited number of paper exams that you may use to finish the exam (but will not have the advantage of typing/editing code.)
- 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 your laptop and sit quietly. Do NOT work on anything else.
- All answers and code must be submitted on Gradescope by 8:30 p.m. and anything after that will be consider a violation and may result in penalties!
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
Practice
Here are some practice exams. Note that the topics they cover might be slightly different from our list of topics (below).
- We strongly recommend trying the algorithmic thinking exercises in the EdStem Lesson: Array Tasks.
- Practice Midterm given in Lab the week before the exam.
- Spring 2023 MT1 and Solutions
- Ignore questions about multi-dimensional (2D- and 3D-) arrays
- 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