CS 1320 (Principles of Algorithm Design I):
Review for Exam #2
Format of the exam
(Everything in this section is the same as it was for Exam #1,
except the date.)
The exam will be in class March 24. You will have 50 minutes.
You may use your textbook and any notes or papers you care to bring,
but you may not use other books, a calculator or computer,
or each other's papers.
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 some C++ code (possibly a complete program, possibly
a fragment), answer one or more of the following questions:
- Will it compile correctly? (You may be told that it
does not.) If not, why not, and how would you fix it?
- What does it print out? What does it (if a function)
return? What value does it assign to a specified
variable? Are these results correct? If not,
what has gone wrong, and how would you fix it?
- Given a problem description, write a C++ program or function
to solve it. You may be given some of the code and asked
to "fill in the blanks", or you may be given descriptions
of C++ functions to use in your solution.
- Convert a given integer from one number system to another.
Topics to review
You are responsible for all material covered in class or in the
assigned reading,
with the exception of material in Chapter 9, which will not be
covered on this exam.
(See Homeworks and other Assignments
for a list of assigned reading.)
This exam will focus on material presented since Exam #1, but
will inevitably include earlier material as well, since it's
hard to imagine writing programs without variable declarations,
etc.
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
from the material since the previous exam.
- Additional data types:
- Loops and C++ loop constructs:
- while loops.
- do .... while loops.
- for loops.