This preview shows page 1. Sign up to view the full content.
Unformatted text preview: e two!
You're unlikely to do well on a test if you don't understand the core concepts, but there is
no guarantee about the inverse. Some students who are quite accomplished in practice
don't manage to demonstrate that same proficiency in the exam setting. Writing code on
paper under time constraints is different than working at the computer. Most students
need practice to adapt their skills. We recommend you sit down with the problems and
write out solutions in longhand. This is much more valuable than a passive review of the
problem alongside its solution where it is too easy to conclude "ah, yes, I would have
done that" only to find yourself sad during the real exam when there is no provided
solution to agree with!
The rest of this handout is the midterm I gave last quarter in CS107 so you can consider
the questions fairly representative in terms of format, difficulty, and content. To conserve
paper, I cut back on answer space. The real exam will have much more room for your
answers and scratch work. We'll distribute solutions in the next lecture. There are also
many excellent problems in the K&R and B&O texts if you'd like further practice. –2–
Problem 1: C-strings
Write the Subtract function that takes a string outer and string inner and returns a new
string consisting of outer with the first occurrence of inner removed, or NUL...
View Full Document
This note was uploaded on 02/06/2014 for the course CS 106X taught by Professor Cain,g during the Winter '08 term at Stanford.
- Winter '08