CS 1320 (Principles of Algorithm Design I):
Review for Exam #1
Format of the exam
The exam will be in class October 1. You will have 50 minutes.
You may use your textbook, but no other books or notes,
nor may you use a calculator, a computer, or each other's papers.
If you have kept up with the reading, the homeworks (including
Homework #3), 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.
Topics to review
You are responsible for all material covered in class or in the
assigned reading.
(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.
- Binary, decimal, and hexadecimal numbers; twos-complement
notation; conversion between number systems.
- Basic C++:
- Variable declarations.
- Arithmetic and boolean expressions.
- Input and output.
- if/then/else and while loops.
- Arrays.
- Problem-solving with C++: designing simple algorithms and
turning them into C++, at the level of the homework problems.