Chapter 4 Control Statements: Part 1
Section 4.2 Algorithms
4.2 Q1: Which of the following is not an algorithm?
a. A recipe.
b. Operating instructions.
c. Textbook index.
d. Shampoo instructions (lather, rinse, repeat).
4.3 Q1: Which of the following is true?
a. Pseudocode is used to describe an algorithm.
b. Pseudocode is not an actual computer programming language.
c. Pseudocode is used to describe executable statements that will eventually be translated by the
programmer into a program.
d. All of the above.
4.4 Q1: Which of the following is not a benefit of “goto–less programming”?
a. Easier to debug and modify
b. Shorter
c. Clearer
d. More likely to be bug free
4.4 Q2: Which of the following is not a control structure:
a. Sequence structure.
b. Selection structure.
c. Repetition structure.
d. Declaration structure.
4.4 Q3: Which of the following is the shape of an action-state symbol?
a. Diamond.
b. Circle.
c. Rectangle with left and right sides replaced with arcs curving outward.
d. Rounded rectangle.
4.4 Q4: Which statement is false?
a. Unless directed otherwise, the computer executes Java statements one after the other in the order in
which they’re written.
b. Activity diagrams normally show the Java code that implements the activity.
c. Like pseudocode, activity diagrams help programmers develop and represent algorithms.
d. The arrows in the activity diagram represent transitions, which indicate the order in which the actions
represented by the action states occur.