2 Introduction To Structured Programming and Problem Solving
2 Introduction To Structured Programming and Problem Solving
Introduction to Structured
Programming and Problem
Solving
MULTIPLE CHOICE
1. The three levels of programming languages discussed in this chapter, in order from the most machine-oriented
to the most human-oriented, are _______.
a. machine language, high-level language, and assembly language
b. machine language, high-level language, and binary representation
c. binary representation, machine language, and assembly language
d. machine language, assembly language, and high-level language
3. Programming languages that are more oriented toward the programmer, rather than the computer are _______
languages.
a. assembly
b. machine
c. low-level
d. high-level
5. BASIC is _______.
a. a machine language
b. short for Beginner’s All-Purpose Symbolic Instruction Code
c. difficult to learn
d. useful only for writing business programs
Chapter 2 Test 2 QBasic
6. The _______ is the sequence of steps that a programmer uses when using the computer as a problem-solving
tool.
a. structure chart
b. programming process
c. problem definition
d. decision step
8. Which of the following is not part of the first step of the programming process?
a. determining the needed output and how it should be formatted
b. determining the needed input
c. documenting the problem definition
d. developing an algorithm
9. _______ graphically represents how a problem solution can be broken into subtasks.
a. A flowchart
b. Pseudocode
c. An algorithm
d. A structure chart
10. A(n) _______ must list every step in a problem solution necessary to get the correct output from the input.
a. algorithm
b. problem definition
c. programming process
d. input chart
11. Which of the following is not one of the three basic types of control structures with which any program can be
written?
a. the loop structure
b. the addition statement
c. the decision structure
d. the sequence
12. _______ is a method of solving a problem by proceeding from the general to the specific.
a. Flowcharting
b. Problem definition
c. Top-down design
d. Pseudocoding
13. Which of the following is not one of the steps in the programming process?
a. writing and documenting the program
b. defining and documenting the problem
c. designing and documenting a solution
d. printing the results
Chapter 2 Test 3 QBasic
14. Which of the three types of program structures would be the most useful if a program needed to read the names
and test scores of 200 students?
a. the sequence
b. the decision structure
c. the loop structure
d. none
18. Which of the following statements best describes the function of this flowchart?
a. It calculates the time needed to travel a specified distance at a specified speed.
b. It calculates the distance that can be traveled in a specified time at a specified speed.
c. It calculates the speed needed to travel a specified distance in a specified time.
d. It calculates the amount of gas used to travel a specified distance in a specified time.
20. In all, how many input and output steps does this flowchart have?
a. 0
b. 2
c. 3
d. 4
24. A _______ is used to perform repetitive tasks that involve executing a sequence of instructions as many times
as needed.
a. flowchart
b. loop
c. decision structure
d. simple sequence
26. When a program is _______, it is run with a wide variety of data to determine if it always obtains correct
results.
a. debugged
b. compiled
c. tested
d. desk checked
28. When a programmer traces through a program by hand in an attempt to locate errors, he or she is _______ the
program.
a. executing
b. coding
c. desk checking
d. documenting
29. If you used the formula length + width to calculate the area of a rectangle (when it should be length width),
you would have made a _______ error.
a. logic
b. syntax
c. pseudocode
d. debugging
Chapter 2 Test 7 QBasic
SHORT-ANSWER QUESTIONS
31. Write an algorithm to instruct a person to boil a pot of water.
Return to CP1020