Assignment
Contents:
Overview
Topic: High-Level Programming
Related Reading: Ch. 8
Due:
Internet Requirements
You may want an Internet connection for several practice
problems. However you do not necessarily need the connection for
completing the assignment, other than for submission.
Practice Problems
Problems to be Submitted (20 points)
Preface:
Several of these problems ask you questions about the behavior of
sample pieces of something resembling a high-level language, such as
Java. We will use the symbols ">=" to mean "greater than or equal to"
and similarly "<=" to mean "less than or equal to."
The point of these problems is not to worry about the precise syntax
of the statements, but instead to recognize the high-level behaviors which
were discussed in the lecture and text.
- (5 points)
Tell whether the following Boolean Expressions are true or false.
- (6 < 10)
- (7 < 7)
- (8 >= 8)
- ((5 > 3) OR (6 < 2))
- (((7 > 3) OR (4 > 6)) AND (6 < 2))
- (5 points)
What value or sequence of values will be printed when running the following segment of code?
set value of variable 'val' equal to 3;
while (val < 6) do {
print current value of 'val'
add 1 to val
}
- (5 points)
What value or sequence of values will be printed when running the following segment of code?
set value of variable 'val' equal to 11;
while (val >= 7) do {
subtract 1 from val
print current value of 'val'
}
- (5 points)
At the end of Ch. 8 there are a series of "Thought Questions" (p. 272-273).
Choose one of question #1, #2 or #3 to answer. The length of your answer
should be appropriate for the question, however I envision answers in
the range of 1/2-page to 1-page. You may certainly use the web for
research on any of those questions, however you should cite your
sources appropriately.
Overall, please type your answers to all of the problems in a
single document to be submitted electronically. Please see details about the
submission process.
Extra Credit (2 points)
Answer an additional Thought Question from among questions #1, #2
and #3 of Ch. 8.
Last modified: 12 November 2002