Chapter 1: An Overview of Computers and Programming
TRUE/FALSE
1. Software can be classified into two broad types: application software and programming
software.
Answer: False
2. Every programming language has rules governing its word usage and punctuation.
Answer: True
3. Besides the popular, comprehensive programming languages such as Java and C++, many
programmers use scripting languages such as Python, Lua, Perl, and PHP.
Answer: True
4. Professional computer programmers write programs to satisfy their own needs.
Answer: False
5. The heart of the programming process lies in planning the program’s logic.
Answer: True
6. Once a program is completely coded, it is ready for a company or organization to use.
Answer: False
7. A flowchart is an English-like representation of the logical steps necessary to solve a
problem.
Answer: False
8. An infinite loop is a flow of program logic that repeats and never ends.
Answer: True
9. Alan Turing is often regarded as the first programmer.
Answer: False
10. Programmers can use either procedural programming or object-oriented programming to
develop programs.
Answer: True
MULTIPLE CHOICE
1. ____ data items may involve organizing or sorting them, checking them for accuracy, or
performing calculations with them.
a. Processing
b. Inputting
c. Outputting
d. Converting
Answer: A
2. ____ errors are relatively easy to locate and correct because the compiler or interpreter you
use highlights every error.
a. Logic
b. Syntax
c. Input
d. Process
Answer: B
3. If you use an otherwise correct word that does not make sense in the current context,
programmers say you have committed a ____ error.
a. syntax
b. logic
c. semantic
d. programming
Answer: B
4. A(n) ___ is a named memory location whose value can vary.
a. input
b. variable
c. output
d. logic
Answer: B
5. Computer programmers often refer to memory addresses using ____ notation.
a. binary
b. indirect
c. mathematical
d. hexadecimal
Answer: D
6. Before a programmer plans the logic of the program, he or she must ____.
a. understand the problem
b. write the program code
c. test the program
d. maintain the program
Answer: A
7. After a programmer plans the logic of a program, the next step is ____.
a. understanding the problem
b. testing the program
c. translating the program
d. coding the program
Answer: D
8. The process of walking through a program’s logic on paper before you actually write the
program is called ____.
a. desk-checking
b. flowcharting
c. pseudocoding
d. testing
Answer: A
9. Typically, a programmer develops a program’s logic, writes the code, and ____ the
program, receiving a list of syntax errors.
a. runs
b. compiles
c. executes
d. tests
Answer: B
10. The process of finding and correcting program errors is called ____.
a. desk-checking
b. syntax-checking
c. error correcting
d. debugging
Answer: D
11. After programs are put into production, making necessary changes is called _____.
a. debugging
b. conversion
c. maintenance
d. testing
Answer: C
12. Using ____ involves writing down all the steps you will use in a program.
a. a compiler
b. an interpreter
c. a flowchart
d. pseudocode
Answer: D
13. In a flowchart, the ____ is used to represent processing.
a. circle
b. diamond
c. triangle
d. rectangle
Answer: D
14. The ____ is used to represent output in a flowchart.
a. square
b. circle
c. parallelogram
d. triangle
Answer: C
15. The ____ is the standard terminal symbol for a flowchart.
a. circle
b. lozenge
c. diamond
d. square
Answer: B
16. The repetition of a series of steps is called a(n) ____.
a. repeat flow
b. loop
c. flow
d. infinite loop
Answer: B
17. A(n) ____ is a repeating flow of logic with no end.
a. nonterminated condition
b. infinite loop
c. variable
d. decision symbol
Answer: B
18. You represent a decision in a flowchart by drawing a decision symbol, which is shaped
like a ____.
a. parallelogram
b. square
c. diamond
d. circle
Answer: C
19. Many programming languages use the term ____ to refer to the marker that is used to
automatically recognize the end of data in a file.
a. data_end
b. end_data
c. eof
d. eod
Answer: C
20. A(n) ____ tells the user what to enter.
a. command line
b. input screen
c. prompt
d. data line
Answer: C
21. A(n) ____ is a program that you use to create simple text files.
a. text editor
b. IDE
c. GUI
d. GDE
Answer: A
22. A(n) ____ is a software package that provides an editor, a compiler, and other
programming tools.
a. GUI
b. CGI
c. GDE
d. IDE
Answer: D
23. A(n) ____ is a location on your computer screen where you type text entries to
communicate with the computer’s operating system.
a. input line
b. communication line
c. command line
d. GCI
Answer: C
24. A ____ allows users to interact with a program in a graphical environment.
a. GCI
b. CGI
c. command line
d. GUI
Answer: D
25. The major difference between the two main programming styles in use today is the ____.
a. use of flowcharts versus pseudocode
b. testing procedure used by the programmer
c. programmer’s focus during the earliest planning stages of a project
d. programming language used
Answer: C
COMPLETION
1. When instructions are carried out, a program runs, or ____________________.
Answer: executes
2. A(n) ____________________ is the sequence of steps necessary to solve any problem.
Answer: algorithm
3. When you draw a flowchart, you use a(n) ____________________ to represent the input
symbol, which indicates an input operation.
Answer: parallelogram
4. A preselected value that stops the execution of a program is often called a(n)
____________________ value because it does not represent real data.
Answer: dummy
5. A(n) ____________________ programmer would approach a problem by dividing the
process into manageable subtasks.
Answer:
procedural
proceedural
MATCHING
Match each term with a statement below.
1. Equipment, or the physical devices, associated with a computer a. volatile memory
2. Instructions that tell the computer what to do b. software
3. Contents are lost when the computer is turned off or loses power c. syntax error
4. Represent(s) the millions of on/off circuits within the computer d. machine language
5. Incorrectly spelled words, or reversing the proper order of two words in a computer
program e. sentinel
6. All the supporting paperwork for a program f. pseudocode
7. Pictorial representation of the logical steps it takes to solve a problem g. hardware
8. English-like representation of the logical steps it takes to solve a problem h. flowchart
9. Used to show the correct sequence of statements i. flowlines
10. Preselected value that stops the execution of a program j. documentation
1. Answer: G
2. Answer: B
3. Answer: A
4. Answer: D
5. Answer: C
6. Answer: J
7. Answer: H
8. Answer: F
9. Answer: I
10. Answer: E
SHORT ANSWER
1. Describe internal and permanent storage.
Answer: When you type program instructions, they are stored in computer memory, which is
a computer’s temporary, internal storage. Internal storage is volatile—its contents are lost
when the computer is turned off or loses power. Usually, you want to be able to retrieve and
perhaps modify the stored instructions later, so you also store them on a permanent storage
device, such as a disk. Permanent storage devices are nonvolatile—that is, their contents are
persistent and are retained even when power is lost.
2. Describe the function of a compiler and an interpreter.
Answer: Each programming language uses a piece of software, called a compiler or an
interpreter, to translate your program code into machine language. Machine language is also
called binary language, and is represented as a series of 0s and 1s. The compiler or interpreter
that translates your code tells you if any programming language component has been used
incorrectly. Syntax errors are relatively easy to locate and correct because the compiler or
interpreter you use highlights every syntax error. If you write a computer program using a
language such as C++ but spell one of its words incorrectly or reverse the proper order of two
words, the software lets you know that it found a mistake by displaying an error message as
soon as you try to translate the program.
3. What is a variable and how is it used in a program?
Answer: Suppose the location myNumber is a variable. A variable is a named memory
location whose value can vary—for example, the value of myNumber might be 3 when the
program is used for the first time, and 45 when it is used the next time.
4. What is involved in putting a program into production?
Answer: Once the program is tested adequately, it is ready for the organization to use. Putting
the program into production might mean simply running the program once, if it was written
to satisfy a user’s request for a special list. However, the process might take months if the
program will be run on a regular basis, or if it is one of a large system of programs being
developed. Perhaps data-entry people must be trained to prepare the input for the new
program; users must be trained to understand the output; or existing data in the company
must be changed to an entirely new format to accommodate this program. Conversion, the
entire set of actions an organization must take to switch over to using a new program or set of
programs, can sometimes take months or years to accomplish.
5. How is a decision represented in a flowchart?
Answer: You represent a decision in a flowchart by drawing a decision symbol, which is
shaped like a diamond. The diamond usually contains a question, the answer to which is one
of two mutually exclusive options—often yes or no. All good computer questions have only
two mutually exclusive answers, such as yes and no, or true and false. For example, “What
day of the year is your birthday?” is not a good computer question because there are 366
possible answers. But “Is your birthday June 24?” is a good computer question because, for
everyone in the world, the answer is either yes or no.
6. How does a program recognize the end of an input file?
Answer: Programming languages can recognize the end of data in a file automatically,
through a code that is stored at the end of the data. Many programming languages use the
term eof (for “end of file”) to refer to this marker that automatically acts as a sentinel.
7. Discuss two ways that you can enter a program into a computer.
Answer: To enter the program into a computer so you can translate and execute it, you
usually use a keyboard to type program statements into an editor. You can type a program
into one of the following:
A plain text editor
A text editor that is part of an integrated development environment
A text editor is a program that you use to create simple text files. It is similar to a word
processor, but without as many features. You can use a text editor such as Notepad that is
included with Microsoft Windows. An advantage to using a simple text editor to type and
save a program is that the completed program does not require much disk space for storage.
You can use the editor of an integrated development environment (IDE) to enter your
program. An IDE is a software package that provides an editor, a compiler, and other
programming tools.
8. List the features that are commonly included with an IDE editor.
Answer: It uses different colors to display various language components, making elements
like data types easier to identify.
It highlights syntax errors visually for you.
It employs automatic statement completion; when you start to type a statement, the IDE
suggests a likely completion, which you can accept with a keystroke.
It provides tools that allow you to step through a program’s execution one statement at a time
so you can more easily follow the program’s logic and determine the source of any errors.
9. What are some of the features provided by modern programming languages that were not
available in older programming languages?
Answer: People have been writing modern computer programs since the 1940s. The oldest
programming languages required programmers to work with memory addresses and to
memorize awkward codes associated with machine languages. Newer programming
languages look much more like natural language and are easier to use, partly because they
allow programmers to name variables instead of using awkward memory addresses. Also,
newer programming languages allow programmers to create self-contained modules or
program segments that can be pieced together in a variety of ways. The oldest computer
programs were written in one piece, from start to finish, but modern programs are rarely
written that way—they are created by teams of programmers, each developing reusable and
connectable program procedures. Writing several small modules is easier than writing one
large program, and most large tasks are easier when you break the work into units and get
other workers to help with some of the units.
10. Currently, there are two major techniques used to develop programs and their procedures.
Name and describe them.
Answer: One technique, procedural programming, focuses on the procedures that
programmers create. In other words, procedural programmers focus on the actions that are
carried out—for example, getting input data for an employee and writing the calculations
needed to produce a paycheck from the data. Procedural programmers would approach the
job of producing a paycheck by breaking down the paycheck-producing process into
manageable subtasks.
The other popular programming model, object-oriented programming, focuses on objects, or
“things,” and describes their features (or attributes) and their behaviors. For example, objectoriented programmers might design a payroll application by thinking about employees and
paychecks, and describing their attributes (e.g., employees have names and Social Security
numbers, and paychecks have names and check amounts).
Test Bank for Programming Logic and Design
Joyce Farrell
9781111969752, 9788131525906, 9781111825959