CS112: Exam 2 :: Coverage and Format
Date and Topics
The second CS112 exam will be held in class on Monday,
April 22. The exam will be an open book exam, so you can
refer to the text or any of your lecture or lab handouts, notes, assignments and
solutions during the exam. The exam will focus on the following topics:
- user-defined functions
- input and output parameters for functions
- using
nargin
with optional inputs
- single and nested
for
loops
-
while
loops
- using
break
to terminate loops
-
if
statements using elseif
clauses
- structures
- strings and cell arrays
- managing files and folders (
load, save, xlsread, pwd, filesep, dir, mkdir
)
- reading/writing text files (
fopen, fclose, textscan, fprintf
)
There will not be any questions on GUIs
There will be a review for the exam during lab on Tuesday, April 16.
Material to review
The following reading, handouts and course work will be most relevant for
preparing for the exam:
- Gilat text (fifth or sixth edition): pages 53-55, 103-110, 187-188, 192-202, 221-231
- Lecture handouts for Lectures #9, 10, 13, 14, 17, 18, and 19
- Lab handouts for Labs #5, 6, 7 (structures), 9, and 10
- Assignments #4, 5, 7, and solutions
Types of problems
The following is a list of some of the kinds of problems that may appear on the exam:
- Given some MATLAB code, hand simulate the execution of the code, showing all of the
values that are returned by the code statements
- Given MATLAB code that embodies one solution strategy, rewrite the code using a
different approach that will be described explicitly
- Given a short description of a task, write code to perform this task (this may
involve writing an extended loop or function, for example)
- Given some buggy code, locate and describe the errors and suggest a way to fix the errors.