CS 1320 (Principles of Algorithm Design I):
Review for Exam #2
Format of the exam
The exam will be in class November 5. You will have 50 minutes.
You may use your textbook and any notes or papers you want to bring,
but you may not use other books,
a calculator, a computer, or each other's papers.
If you have kept up with the reading, the homeworks
(including Homework #7), and the material covered in the quizzes,
you should be fairly well prepared already.
The following are some kinds of questions that might be on the exam.
It is not necessarily an exhaustive list
of all types of questions on
the exam, but should give you an idea of what to expect.
- Given a short C++ program, say what it prints out when
executed.
- Given a C++ program that is known to be incorrect (does not
compile, or does not produce the expected results),
explain what is wrong and/or how to fix it.
If the program does not compile, you will be told what
error messages the compiler produces; if it produces
wrong results, you will be told what these wrong results are.
- Given a problem, write a C++ program to solve it.
- Given a problem and a C++ program that partially solves it
(i.e., a program with some "holes" to fill in), complete
the program.
- Given descriptions of some functions (prototypes and comments
indicating what the functions do), write a program using
the functions.
Topics to review
You are responsible for all material covered in class or in the
assigned reading.
This exam will focus on material covered since the previous exam,
but it will inevitably also include material covered earlier in
the course.
See Homeworks and other Assignments
for a list of assigned reading.
You should review in particular the following
topics. Again, this list is
not necessarily exhaustive, but should
give you an idea of what topics I consider most significant.
- for loops.
- Using library functions.
- Declaring, defining, and using functions.
- Type casting.
- Strings.
- Top-down design.
- File input/output using streams.
- Call by value, call by reference.