Program Design chapter 2 and 3 (Multiple Choice) – Flashcards

Unlock all answers in this set

Unlock answers
question
____ variables and constants are known to the entire program. a. Local c. Transient b. Heap d. Global
answer
D
question
When you write programs, you work with data in three different forms: ____. a. variables; literals, or unnamed constants; and named constants b. variations; transliterals, or unnamed constants; and named values c. values; variables, or named values; and unnamed values d. variables; named constants; and named memory
answer
A
question
The priming read is an example of a(n) ____ task. a. housekeeping c. exit b. selection d. declaration
answer
A
question
A ____ variable is not used for input or output, but instead is just a working variable that you use during a program's execution. a. programming c. temporary b. calculating d. throw away
answer
C
question
A ____ read is an added statement that gets the first input value in a program. a. stacked c. nested b. posttest d. priming
answer
D
question
____ is where a variable's data type or other information is stored as part of the name. a. Camel case c. Hungarian notation b. Turing notation d. Pascal case
answer
C
question
With a(n) ____, you perform an action or task, and then you perform the next action, in order. a. ordered structure c. sequence problem b. loop sequence d. sequence structure
answer
D
question
A variable's unknown value is commonly called ____. a. initial c. garbage b. deterministically random d. default
answer
C
question
The do loop is a variation of the ____ loop. a. case c. if-then-else b. while d. sequence
answer
B
question
In older languages, you could leave a selection or loop before it was complete by using a ____ statement. a. go next c. go to b. next d. loop
answer
C
question
A(n) ____ is similar to a variable, except it can be assigned a value only once. a. literal c. named constant b. constant d. unnamed constant
answer
C
question
____ is the process of paying attention to important properties while ignoring nonessential details. a. Modularization c. Abstraction b. Decomposition d. Abbreviation
answer
C
question
Programmers say that variables and constants declared within a module are ____ only within that module. a. out of scope c. abstracted b. in scope d. in reference
answer
B
question
The following pseudocode is an example of ____. if conditionA is true then do stepE else do stepB do stepC do stepD endif a. nesting c. a posttest b. a pretest d. stacking
answer
A
question
The process of breaking down a large program into modules is called ____. a. unification c. orientation b. modularization d. decomposition
answer
B
question
Programmers refer to programs that contain meaningful names as ____. a. self-documenting c. formally documented b. procedurally documented d. undocumented
answer
A
question
Attaching structures end to end is called ____ structures. a. linking c. nesting b. stacking d. building
answer
B
question
An ____ is most often represented by a three-sided box that is connected to the step it references by a dashed line. a. enumeration symbol c. annotation symbol b. abstraction symbol d. abbreviation symbol
answer
C
question
As programs become larger and more complicated, the need for good planning and design ____ . a. is not necessary c. decreases b. is inefficient d. increases
answer
D
question
Programs that use _____ code logic are unstructured programs that do not follow the rules of structured logic. a. nested c. case b. spaghetti d. loop
answer
B
question
You may hear programmers refer to looping as ____. a. execution c. case b. selection d. iteration
answer
D
question
Depending on the programming language being used, modules are also known as ____ . a. subroutines, code bits, or methods c. subroutines, procedures, or methods b. tasks, functions, or methods d. procedures, functions, or hierarchy
answer
C
question
The process of naming program variables and assigning a type to them is called ____ variables. a. declaring c. initializing b. proclaiming d. identifying
answer
A
question
The case structure is a variation of the ____ structure. a. do c. sequence b. while d. selection
answer
D
question
A loop must return to the ____ question at some later point in a structure. a. loop-controlling c. continue loop b. start loop d. master loop
answer
A
question
When a program has several modules calling other modules, programmers often use a program ____, which operates similarly to an organizational chart, to show the overall picture of how modules are related to one another. a. tree chart c. data diagram b. flow chart d. hierarchy chart
answer
D
question
Declaring a starting value for a variable is known as ____ the variable. a. initializing c. declaring b. defining d. identifying
answer
A
question
One way to straighten out an unstructured flowchart segment is to use the ____ method. a. restructuring c. spaghetti code b. priming d. spaghetti bowl
answer
D
question
The assignment operator is the ____ sign. a. / c. + b. * d. =
answer
D
question
The following pseudocode is an example of ____. do stepA do stepB if conditionC is true then do stepD else do stepE endif while conditionF is true do stepG endwhile a. stacking c. single alternative structures b. nesting d. a posttest
answer
A
question
A specific numeric value is often called a(n) ____. a. numeric constant c. arithmetic constant b. named constant d. defined constant
answer
A
question
The following pseudocode is an example of a ____ structure. get number while number is positive add to sum get number a. nested c. sequence b. decision d. loop
answer
D
question
In an assignment statment, the part of the statement on the left-hand side of the equal sign is called what? a. rvalue c. binary value b. lvalue d. address
answer
B
question
When the variable starts with a lowercase letter and any subsequent word begins with an uppercase letter, this is called ____. a. Pascal casing c. Hungarian notation b. Turing notation d. camel casing
answer
D
question
The mainline logic of almost every procedural computer program consists of these three distinct parts: ____ . a. housekeeping tasks, detail loop tasks, and math tasks b. clearing tasks, detail loop tasks, and end-of-job tasks c. housekeeping tasks, detail loop tasks, and end-of-job tasks d. housekeeping tasks, processing tasks, and end-of-job tasks
answer
C
question
The following pseudocode is an example of a ____ structure. get firstNumber get secondNumber add firstNumber and secondNumber print result a. decision c. sequence b. nested d. loop
answer
C
question
Fill in the blank in the following pseudocode: if someCondition is true then do oneProcess ____ do theOtherProcess a. do c. while b. else d. then
answer
B
question
Instead of using a specific numeric value called a ____________ repeatedly throughout your code without explanation, you should instead used a named constant. a. magic number c. string literal b. magical thought d. string named constant
answer
A
question
The following pseudocode is an example of a ____ structure. if firstNumber is bigger than secondNumber then print firstNumber else print secondNumber a. nested c. sequence b. decision d. loop
answer
B
question
When the first letter of a variable name is uppercase, as in HourlyWage, the format is known as ____ casing. a. Pascal casing c. camel casing b. Turing notation d. Hungarian notation
answer
A
question
Placing a structure within another structure is called ____ structures. a. nesting c. selecting b. shelling d. stacking
answer
A
question
The maximum number of entry points that any programming structure can have is ____. a. zero c. three b. one d. five
answer
B
question
The ____ dictate the order in which operations in the same statement are carried out. a. statement rules c. rules of precedence b. operation rules d. rules of arithmetic
answer
C
question
Structured programs can be easily broken down into routines or ____ that can be assigned to any number of programmers. a. segments c. modules b. sequences d. units
answer
C
question
In most programming languages, before you can use any variable, you must include a ____ for it. a. proclamation c. definition b. declaration d. header
answer
B
question
You can use an ____ statement to clearly show where the actions that depend on a decision end. a. end c. endstructure b. endloop d. endif
answer
D
question
if-else examples can also be called ____ because they contain the action taken when the tested condition is true and the action taken when it is false. a. repetition c. do loops b. single-alternative selections d. dual-alternative selections
answer
D
question
The action or actions that occur within a loop are known as a(n) ____. a. structure body c. loop internals b. loop body d. action body
answer
B
question
Programmers say the statements that are contained in a module have been ____. a. encapsulated c. decomposed b. modularized d. embedded
answer
A
question
Structures can be stacked or connected to one another at their ____. a. entry or exit points c. entry or combination points b. exit points only d. entry points only
answer
A
question
Fractional numeric variables that contain a decimal point are known as ____ variables. a. partial c. string b. integer d. floating-point
answer
D
question
A structured program includes only combinations of the three basic structures: ____. a. sequence, selection, and loop b. sequence, iteration, and loop c. identification, selection, and loop d. iteration, selection, and loop
answer
A
Get an explanation on any task
Get unstuck with the help of our AI assistant in seconds
New