Chapter 2  Problem Solving

Section 2.1  Program Development Cycle

1.         An algorithm is defined as:

(A)  a mathematical formula that solves a problem.

(B)  a tempo for classical music played in a coda.

(C)  a logical sequence of steps that solve a problem.

(D)  a tool that designs computer programs and draws the user interface.

 

2.         Which of the following is the proper order of procedures used in the problem-solving process?

(A)  design, analysis, coding, testing

(B)  analysis, testing, design, coding

(C)  analysis, design, coding, testing

(D)  analysis, design, testing, coding

(E)   design, testing, analysis, coding

 

3.         The process of finding and correcting errors in a program is called

(A)  pseudocoding.

(B)  debugging.

(C)  algorithms.

(D)  development cycles.

 

4.         In most cases, a well-written program need not be tested. (T/F)

 

5.         The analysis and design steps of program planning are largely independent of the particular computer language the programmer is using. (T/F)

 

6.         When starting a new program, it is best to start writing code as soon as possible to avoid wasting time thinking about it. (T/F)

 

7.         Often a problem is too difficult to understand until one writes the program. (T/F)

 

8.         Although the documentation step is usually listed last in the problem-solving process, it should actually begin when the problem is first defined and continue through the problem-solving process. (T/F)

 

9.         Order the steps in the program development cycle starting with 1 for the first step and so on.

____

Program design (devise an algorithm).

____

Test the program until it is error free.

____

Test the design.

____

Problem analysis (define the problem).

____

Determine the input and output.

____

Review the code.

____

Add new features.

____

Code the program.

____

Enter the program.

 

Section 2.2  Programming Tools

1.         What does the parallelogram flowchart symbol represent?

(A)  input/output

(B)  terminal

(C)  decision

(D)  connector

(E)   process

 

2.         Pseudocode is

(A)  data that have been encoded for security.

(B)  the incorrect results of a computer program.

(C)  a program that doesn't work.

(D)  the obscure language computer personnel use when speaking.

(E)   a description of an algorithm similar to a computer language.

 

3.         Which one of the following is NOT one of the three basic types of statement structures?

(A)  sequence

(B)  loop

(C)  decision

(D)  input/output

 

4.         Which of the following types of charts shows only the relationships between general program tasks without showing specific modules or directions for data flow?

(A)  top-down chart

(B)  flowchart

(C)  both A and B

(D)  neither A nor B

 

5.         Suppose in the very early stages of the problem-solving process, your supervisor wants you to show her the relationships between the various processes that will be needed to solve the problem. The best way to do this would be to use

(A)  a top-down chart.

(B)  a flowchart.

(C)  a sample program.

(D)  pseudocode.

 

6.         If you are writing a program that needs to repeat a series of calculations, what programming structure should you use to repeat the calculations?

(A)  sequence structure

(B)  decision structure

(C)  looping structure

(D)  unconditional branching

 

7.         "Desk-checking" refers to

(A)  the continual problem programmers have with losing things.

(B)  timing a program to see how fast it completes its tasks.

(C)  testing an algorithm at the flowchart stage using several different kinds of data.

(D)  having a fellow programmer read your pseudocode to be sure it is understandable.

 

8.         What does the rectangle flowchart symbol represent?

(A)  input/output

(B)  terminal

(C)  decision

(D)  connector

(E)   process

 

9.         What does the diamond flowchart symbol represent?

(A)  input/output

(B)  terminal

(C)  decision

(D)  connector

(E)   process

 

10.     What does the circle flowchart symbol represent?

(A)  input/output

(B)  terminal

(C)  decision

(D)  connector

(E)   process

 

11.     What does the “rectangle with rounded sides” flowchart symbol represent?

(A)  input/output

(B)  predefined process

(C)  decision

(D)  start/stop

(E)   process

 

12.     A graphical depiction of the logical steps to carry out a task and show how the steps relate to each other is called a(n)

(A)  flowchart.

(B)  pseudocode.

(C)  algorithms.

(D)  hierarchy chart.

 

13.     A flowchart is an arrangement of geometric shapes connected by arrows. (T/F)

 

14.     A top-down chart is the same thing as a flowchart. (T/F)

 

15.     Pseudocode and flowcharts are two different tools or methods used in planning a solution to a problem. (T/F)

 

16.     Suppose your supervisor at work wants you to write a program to accomplish a task that he has specified. However, he has not let you know which computer language to use. It is still possible to design the program in pseudocode. (T/F)

 

17.     During the design phase, all errors will be caught by Visual Basic's smart editor. (T/F)

 

18.     Although a flowchart (as its name suggests) depicts data flow very well, it is not easily modified once written. (T/F)

 

19.     If a problem is very complex, extensive design prior to coding will actually delay the completion of the project. (T/F)

 

20.     The divide-and-conquer-method of problem solving breaks a problem into large, general pieces first, then refines each piece until the problem is manageable. (T/F)

 

21.     The purpose of a test or decision in a looping structure is to tell when the loop should end. (T/F)

 

22.     Flowcharts, pseudocode, and top-down charts can be used to solve problems only in Visual Basic. (T/F)

 

23.     What are the three basic methods of control used in designing structured algorithms?

 

24.     Define the following:

(A)  algorithm

(B)  pseudocode

(C)  flowchart

(D)  syntax

(E)   run-time error

(F)   logical error

(G)  top-down design

(H)  stepwise refinement

25.     Name the three basic control structures and briefly describe each of them.