Deck 2: Elements of High-Quality Programs
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/59
Play
Full screen (f)
Deck 2: Elements of High-Quality Programs
1
All programming languages support four broad data types.
False
2
Because one memory location can be used repeatedly with different values,you can write program instructions once and then use them for thousands of separate calculations
True
3
Programmers generally write programs as one long series of steps.
False
4
Modularization makes it harder for multiple programmers to work on a problem.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
5
When you write programs,you work with data in three different forms: ____.
A) values,variables (or named values),and unnamed values
B) variables,named constants,and named memory
C) variables,literals (or unnamed constants),and named constants
D) variations,RAM (or unnamed constants),and named values
A) values,variables (or named values),and unnamed values
B) variables,named constants,and named memory
C) variables,literals (or unnamed constants),and named constants
D) variations,RAM (or unnamed constants),and named values
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
6
The assignment operator has left-to-right-to-left associativity,which means that the value of the expression to the left of the assignment operator is evaluated first and that the result is assigned to the operand on the right.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
7
A specific numeric value is often called a(n)____.
A) named constant
B) defined constant
C) arithmetic constant
D) numeric constant
A) named constant
B) defined constant
C) arithmetic constant
D) numeric constant
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
8
In most programming languages,before you can use any variable,you must include a ____ for it.
A) declaration
B) definition
C) header
D) proclamation
A) declaration
B) definition
C) header
D) proclamation
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
9
Most modern programming languages require that program statements be placed in specific columns.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
10
When the first letter of a variable name is uppercase,as in HourlyWage,the format is known as ____ casing.
A) Hungarian notation
B) Pascal casing
C) camel casing
D) Turing notation
A) Hungarian notation
B) Pascal casing
C) camel casing
D) Turing notation
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
11
A string variable can hold digits such as account numbers and zip codes.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
12
Program comments are a type of internal documentation.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
13
Declaring a starting value for a variable is known as ____ the variable.
A) initializing
B) declaring
C) defining
D) identifying
A) initializing
B) declaring
C) defining
D) identifying
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
14
A variable's unknown value is commonly called ____.
A) initial
B) default
C) random
D) garbage
A) initial
B) default
C) random
D) garbage
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
15
The process of naming program variables and assigning a type to them is called ____ variables.
A) initializing
B) declaring
C) identifying
D) proclaiming
A) initializing
B) declaring
C) identifying
D) proclaiming
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
16
In many programming languages,if you declare a variable and do not initialize it,the variable contains an unknown value until it is assigned a value.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
17
Fractional numeric variables that contain a decimal point are known as ____ variables.
A) partial
B) string
C) integer
D) floating-point
A) partial
B) string
C) integer
D) floating-point
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
18
Variable names can be more than one word with blanks between the words.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
19
____ is where a variable's data type or other information is stored as part of the name.
A) Hungarian notation
B) Pascal case
C) Turing notation
D) Camel case
A) Hungarian notation
B) Pascal case
C) Turing notation
D) Camel case
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
20
When the variable starts with a lowercase letter and any subsequent word begins with an uppercase letter,this is called ____.
A) Hungarian notation
B) Pascal casing
C) camel casing
D) Turing notation
A) Hungarian notation
B) Pascal casing
C) camel casing
D) Turing notation
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
21
Each programming language has a few reserved ____________________ that are not allowed as variable names because they are part of the language's syntax.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
22
____ is the process of paying attention to important properties while ignoring nonessential details.
A) Abstraction
B) Modularization
C) Abbreviation
D) Decomposition
A) Abstraction
B) Modularization
C) Abbreviation
D) Decomposition
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
23
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) hierarchy chart
B) tree chart
C) flow chart
D) data diagram
A) hierarchy chart
B) tree chart
C) flow chart
D) data diagram
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
24
A(n)____ is similar to a variable,except it can be assigned a value only once.
A) unnamed constant
B) literal
C) named constant
D) constant
A) unnamed constant
B) literal
C) named constant
D) constant
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
25
Match each term with a statement below.
-Named memory locations whose contents can vary or differ over time
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
-Named memory locations whose contents can vary or differ over time
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
26
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
B) throw away
C) temporary
D) calculating
A) programming
B) throw away
C) temporary
D) calculating
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
27
Program ___________________ are written explanations that are not part of the program logic but that serve as documentation for readers of the program.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
28
Programmers say the statements that are contained in a module have been ____.
A) embedded
B) decomposed
C) encapsulated
D) modularized
A) embedded
B) decomposed
C) encapsulated
D) modularized
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
29
Programmers refer to programs that contain meaningful names as ____.
A) undocumented
B) procedurally documented
C) formally documented
D) self-documenting
A) undocumented
B) procedurally documented
C) formally documented
D) self-documenting
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
30
Programmers say that variables and constants declared within a module are ____ only within that module.
A) abstracted
B) out of scope
C) in scope
D) in reference
A) abstracted
B) out of scope
C) in scope
D) in reference
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
31
Depending on the programming language being used,modules are also known as ____ .
A) subroutines,procedures,or methods
B) subroutines,receptacles,or methods
C) tasks,functions,or methods
D) procedures,functions,or containers
A) subroutines,procedures,or methods
B) subroutines,receptacles,or methods
C) tasks,functions,or methods
D) procedures,functions,or containers
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
32
As programs become larger and more complicated,the need for good planning and design ____ .
A) decreases
B) is inefficient
C) is not necessary
D) increases
A) decreases
B) is inefficient
C) is not necessary
D) increases
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
33
The ____ dictate the order in which operations in the same statement are carried out.
A) rules of precedence
B) statement rules
C) operation rules
D) rules of arithmetic
A) rules of precedence
B) statement rules
C) operation rules
D) rules of arithmetic
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
34
The process of breaking down a large program into modules is called ____.
A) decomposing
B) modularization
C) fragmentation
D) caching
A) decomposing
B) modularization
C) fragmentation
D) caching
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
35
The mainline logic of almost every procedural computer program consists of these three distinct parts: ____ .
A) housekeeping tasks,main tasks,and end-of-job 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,detail loop tasks,and math tasks
A) housekeeping tasks,main tasks,and end-of-job 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,detail loop tasks,and math tasks
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
36
___________________ tasks include any steps you must perform at the beginning of a program to get ready for the rest of the program.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
37
In a flowchart,an ____ is most often represented by a three-sided box that is connected to the step it references by a dashed line.
A) abstraction symbol
B) annotation symbol
C) abbreviation symbol
D) enumeration symbol
A) abstraction symbol
B) annotation symbol
C) abbreviation symbol
D) enumeration symbol
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
38
____ variables and constants are known to the entire program.
A) Local
B) Transient
C) Heap
D) Global
A) Local
B) Transient
C) Heap
D) Global
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
39
Whole number variables are known as ____________________ variables.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
40
Declaring a starting value is known as ____________________ the variable.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
41
List three reasons for modularizing a large program.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
42
What does a data item's data type describe?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
43
Match each term with a statement below.
-A message that is displayed on a monitor to ask the user for a response and perhaps explain how that response should be formatted
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
-A message that is displayed on a monitor to ask the user for a response and perhaps explain how that response should be formatted
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
44
What are end-of-job tasks?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
45
Match each term with a statement below.
-Can hold digits and have mathematical operations performed on it
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
-Can hold digits and have mathematical operations performed on it
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
46
Match each term with a statement below.
-The feature of programming languages that prevents assigning values of an incorrect data type
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
-The feature of programming languages that prevents assigning values of an incorrect data type
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
47
Discuss why it is important to use meaningful names for identifiers.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
48
Explain the purpose of detail loop tasks.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
49
Match each term with a statement below.
-Can hold text,such as letters of the alphabet,and other special characters,such as punctuation marks
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
-Can hold text,such as letters of the alphabet,and other special characters,such as punctuation marks
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
50
What items should you include when you create a module?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
51
Explain the purpose of temporary variables.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
52
Match each term with a statement below.
-A list of every variable name used in a program,along with its type,size,and description
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
-A list of every variable name used in a program,along with its type,size,and description
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
53
List three design features that you can use while creating programs to make them easier to write and maintain.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
54
Discuss why it is important to maintain good programming habits.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
55
Match each term with a statement below.
-A statement that provides a data type and an identifier for a variable
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
-A statement that provides a data type and an identifier for a variable
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
56
Match each term with a statement below.
-The act of repeating input back to a user either in a subsequent prompt or in output
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
-The act of repeating input back to a user either in a subsequent prompt or in output
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
57
Match each term with a statement below.
-The feature of programs that assures you a module has been tested and proven to function correctly
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
-The feature of programs that assures you a module has been tested and proven to function correctly
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
58
Match each term with a statement below.
-A program component's name
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
-A program component's name
A)Reliability
B)Declaration
C)Echoing input
D)String variable
E)Identifier
F)Prompt
G)Variables
H)Data dictionary
I)Numeric variable
J)Type-safety
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
59
Explain the purpose of annotation symbols.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck