0% found this document useful (0 votes)
153 views7 pages

2 Introduction To Structured Programming and Problem Solving

This document contains a chapter from a textbook on structured programming and problem solving. It includes 30 multiple choice questions and 2 short answer questions testing understanding of key concepts like the levels of programming languages, machine language, assembly language, high-level languages, structured programming, algorithms, flowcharts, pseudocode, and the programming process.

Uploaded by

A Deshpande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
153 views7 pages

2 Introduction To Structured Programming and Problem Solving

This document contains a chapter from a textbook on structured programming and problem solving. It includes 30 multiple choice questions and 2 short answer questions testing understanding of key concepts like the levels of programming languages, machine language, assembly language, high-level languages, structured programming, algorithms, flowcharts, pseudocode, and the programming process.

Uploaded by

A Deshpande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

C HAPTER2

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

2. Machine language programs are written using _______.


a. English-like words
b. series of 1s and 0s representing high and low electrical states
c. BASIC
d. symbolic names to represent storage locations

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

4. Assembly language programs _______.


a. differ depending on the type of computer on which they are to be executed
b. contain instructions written in 1s and 0s.
c. do not require knowledge of the internal operations of the computer
d. more closely resemble English than BASIC

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

7. Which of the following is true of structured programming?


a. Program logic is easy to follow and the programs are divided into smaller subprograms.
b. Program logic is easy to follow and the programs are written in machine language.
c. The programs are divided into smaller subprograms and the programs are written in machine language.
d. The programs are written in assembly language and are divided into smaller subprograms.

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

Use the following flowchart to answer Questions 15–18.

15. How many input steps does this flowchart contain?


a. 0
b. 1
c. 2
d. 3

16. How many output steps does this flowchart contain?


a. 0
b. 1
c. 2
d. 3
Chapter 2 Test 4 QBasic

17. What type of symbol represents the processing step?


a.
b.
c.
d.

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.

Use the following flowchart to answer Questions 19–21.


Chapter 2 Test 5 QBasic

19. How many arithmetic steps does this flowchart have?


a. 1
b. 2
c. 3
d. 4

20. In all, how many input and output steps does this flowchart have?
a. 0
b. 2
c. 3
d. 4

21. Which of the following pseudocodes best corresponds to this flowchart?


a. Begin
Enter height of Christmas tree
Cost = height * 3.00
Cost = cost + cost x 0.05
Output cost
End
b. Begin
Enter height of Christmas tree
Cost = cost + tax
Output cost
Cost = height * 3.00
End
c. Begin
Enter height of Christmas tree
Cost = height * 3.00
Output cost
Tax = cost * 0.05
Cost = cost + tax
End
d. Begin
Cost = height * 3.00
Tax = cost * 0.05
Cost = cost + tax
Output cost
End

22. Pseudocode uses _______ to express a program’s logic.


a. English-like statements
b. an object program
c. geometric symbols
d. stepwise refinement
Chapter 2 Test 6 QBasic

23. In a flowchart, a decision step is represented by which of the following symbols?


a.
b.
c.
d.

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

25. In a flowchart, input or output is represented by which of the following symbols?


a.
b.
c.
d.

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

27. The grammatical rules of a language are its _______.


a. structure
b. syntax
c. pseudocode
d. documentation

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

30. The process of actually writing a program in a programming language is _______.


a. coding
b. pseudocoding
c. compiling
d. debugging

SHORT-ANSWER QUESTIONS
31. Write an algorithm to instruct a person to boil a pot of water.

32. Draw a flowchart showing the steps in making a pizza.

Return to CP1020

You might also like