AITT 4300 Digital Computer Structures
© 2015 Pearson Education
1
Assignment 2 Chapter 3
1. In the first phase of the program development cycle you should: a. make a hierarchy chart b. identify all the variables needed c. identify the desired results d. identify appropriate test data
2. An algorithm must: a. include step‐by‐step instructions b. be well defined and well ordered c. produce some result d. terminate in a finite time e. all of the above are true
3. Which of the following is not part of the analysis phase of the program development cycle? a. determine the required output (the result) b. determine the required input (the data) c. determine the formulas needed to get the required results d. determine the names of all the variables to be used
4. When a programmer breaks tasks down into smaller pieces, this is called: a. flowcharting b. modular programming c. the program development cycle d. hierarchical programming
5. Which of the following are characteristics of a program module? a. It performs a single task b. It is self‐contained c. It is relatively short d. any of the above
6. Which of the following is not a characteristic of a program module? a. it performs a single task b. it is self‐contained and independent of other modules c. it is relatively short d. all of the above are characteristics of a program module
AITT 4300 Digital Computer Structures
© 2015 Pearson Education
2
7. Given the following statements from a certain program: Call Purchase Price module Write “Come back soon” What statement is executed immediately after the Call statement? a. Write “Come back soon” b. The first statement in the Purchase Price module c. Nothing is executed; this is an illegal Call d. It is impossible to tell; not enough information is given
8. Given the following statements from a certain program: Call Purchase Price module Write “Come back soon” What statement is executed immediately after the last statement in the Purchase Price module?
a. Write “Come back soon” b. The first statement in the Purchase Price module c. Nothing is executed; this is an illegal Call d. It is impossible to tell; not enough information is given
9. The two fundamental types of errors that can arise when coding a program are: a. logic and testing errors b. logic and syntax errors c. syntax and testing errors d. coding and testing errors
10. A diagram that uses special symbols to display pictorially the flow of execution of a program
or program module is a(n): a. hierarchy chart b. pseudocode listing c. application chart d. flowchart
11. Which of the following is not a flowchart symbol? a. b.
c.
d.
12. Which of the following is not one of the basic control structures? a. Sequence
AITT 4300 Digital Computer Structures
© 2015 Pearson Education
3
b. Modularization c. Selection d. Repetition
13. The type of control structure that causes a branch forward at some point, causing a portion
of the program to be skipped, is: a. a sequential structure b. a repetition structure c. a selection structure d. a loop structure
14. Which control structure contains a branch back to a previous statement in the program
module, which results in a block of statements that can be executed many times. a. a sequential structure b. a repetition structure c. a selection structure d. one of the above
15. Which type of error causes a program to run but provide incorrect or unexpected results? a. a syntax error b. a logic error c. a modular error d. all of the above
TRUE/FALSE 1. True/False: External documentation consists of comments within a program that explain the
code, step by step. 2. True/False: When a program is written by identifying tasks and subtasks and then writing
modules to deal with each task, this is known as modular programming. 3. True/False: A Call statement transfers program control to the first line of the submodule
that is called. 4. True/False: Variable names must be created before a program can be designed. 5. True/False: A violation of a programming language’s rules for creating valid statements is
considered a logic error.
AITT 4300 Digital Computer Structures
© 2015 Pearson Education
4
6. True/False: A repetition structure consists of a series of consecutive statements that are executed in the order in which they appear.
7. True/False: There are three basic control structures. 8. True/False: Loops and repetition structures are the same thing. 9. True/False: Hierarchy charts are just a different name for flowcharts. 10. True/False: A flowchart is a pictorial representation of the flow of a program. 11. True/False: If you use a flowchart to design a program, you cannot use pseudocode for the
same program. 12. True/False: A sequential structure consists of a series of consecutive statements, executed
in the order in which they appear. 13. True/False: Comments are helpful to programmers but must be used with care since an
incorrectly worded comment can cause a program crash. 14. True/False Structured programming is a method used to design and code programs in a
systematic, organized manner. 15. True/False: Comments are ignored by the computer when the program executes.
SHORT ANSWER 1. A step‐by‐step method for solving a problem in a computer program is a(n) __________. 2. Comments included within a program to explain parts of the code are called __________
_________. 3. Every program has a(n) __________ __________ which is where the program begins and
normally ends. 4. A visual way to keep track of a program’s modules and the relationships between modules is
to create a __________ __________. 5. In a program, statements that are ignored (not processed) by the computer are __________. 6. A programming error that results from failing to use the proper combination of statements
to accomplish a certain task is a(n) __________ error.
AITT 4300 Digital Computer Structures
© 2015 Pearson Education
5
7. In a(n) __________ structure, there is a branch back to a previous statement in the program module.
8. A synonym for a decision structure is a(n) __________ structure. 9. In a __________ structure there is a branch forward at some point, causing a portion of the
program to be skipped. 10. Programming is a __________ process because, after each step it may be necessary to
revise. 11. Two tools used by programmers to design programs before writing actual code are
__________ and __________ 12. Most documentation prepared for the lay person to explain how to use a particular piece of
software is written by a __________ __________. 13. After a program is coded, it must be ____________. 14. Use of an incorrect formula to produce a desired result is a type of __________ error. 15. When you begin to analyze a problem in programming, the first thing you need to
determine is the desired ___________.