Deck 2: Applications and Data

Full screen (f)
exit full mode
Question
A(n) ____ is the name of a programming object - for example, a class, method, or variable.

A)convention
C)keyword
B)identifier
D)class header
Use Space or
up arrow
down arrow
to flip the card.
Question
You can use named constants to make your programs easier to understand by eliminating ____.

A)constants
C)strings
B)variables
D)magic numbers
Question
The convention used in this book for named constants is ____ characters ____ underscores to separate words.

A)uppercase, with
C)lowercase, with
B)uppercase, without
D)lowercase, without
Question
An item's data type defines what operations can be performed on the item.
Question
Which of the following is correct if the data type of inventoryItem is string?

A)inventoryItem = 3
C)inventoryItem = -9
B)inventoryItem = "printer"
D)inventoryItem = (printer)
Question
Which of the following is correct if the data type for weight is num?

A)weight = 2.75
C)weight = (2.75)
B)weight = "2.75"
D)weight = "heavy"
Question
In an interactive program, a ____ enters data.

A)disk
C)user
B)database
D)graphical user interface
Question
Three types of program structures are sequence, selection, and loop.
Question
In echoing input, the program tells the user the desired form of the input data.
Question
A named constant can be assigned a value multiple times.
Question
A(n) ____ is a named set of statements that perform some task or group of tasks within an application.

A)method
C)object
B)class
D)flowchart
Question
An adjective would be a good choice of identifier for a variable that holds status.
Question
String values are also called ____ values.

A)unnamed
C)alphabetic
B)digit
D)alphanumeric
Question
The assignment operator is said to have right-to-left associativity.
Question
A loop structure does not contain a decision point.
Question
A noun would be a good choice for a variable or constant identifier.
Question
Computers deal with two basic types of data - text and string.
Question
A literal numeric constant does not change.
Question
____ constants do not have identifiers like variables do.

A)Alphabetic
C)Unnamed
B)Named
D)Uncertain
Question
There will always be only one class ____ for each class.

A)statement
C)header
B)method
D)footer
Question
Sequences never include ____.

A)terminations
C)decisions
B)tasks
D)steps
Question
What is one drawback to including program comments?

A)They take up too much memory.
C)You cannot use abbreviations.
B)They must be kept current.
D)They make a program difficult to read.
Question
____________________ are named memory locations with contents that can change.
Question
What is an advantage of using the practice of echoing input?

A)The program is shorter.
B)Memory usage is lower.
C)There is less chance of syntax errors.
D)The user is more likely to catch input errors.
Question
The ___ dictate the order in which operations in the same statement are carried out.

A)sequence structures
C)decision points
B)named constants
D)order of operations
Question
A ____ dictionary is a list of every variable name used in a program.

A)naming
C)constant
B)string
D)data
Question
In the following statement, which operation is done third? answer = a + b + c * d / e - f

A)a+b
C)e-f
B)b+c
D)d/e
Question
Most modern programming languages are ____, meaning that you can arrange your lines of code as you see fit.

A)structured
C)formatted
B)columnar
D)free-form
Question
A(n) ____ statement stores the value of the right-hand side of the expression in the memory location of the left-hand side.

A)construct
C)equals
B)arithmetic
D)assignment
Question
A variable ____________________ is a statement that provides a data type and identifier for a variable.
Question
With a ____ structure, you perform an action or event, and then you perform the next action in order.

A)loop
C)selection
B)decision
D)sequence
Question
What operator has the lowest precedence?

A)+
C)*
B)/
D)=
Question
In the following statement, which arithmetic operation is performed first? answer = a + b + c * d / e - f

A)e-f
C)c*d
B)a+b
D)d/e
Question
What is an equivalent way to write the following statement? answer = a + b + c * d / e - f

A)answer = a+b+(c*d)/(e-f)
C)answer = a+b+(c*d/e-f)
B)answer = a+b+(c*d)/e-f
D)answer = a+b+c*(d/e)-f
Question
A ____________________ constant is enclosed within quotation marks.
Question
____________________ programs can accept data without human intervention.
Question
According to the rules of precedence, ____ has higher precedence than addition.

A)multiplication
C)the equals sign
B)subtraction
D)assignment
Question
Programmers refer to programs that contain meaningful names as ____.

A)external documentation
C)internally consistent
B)self-documenting
D)applications
Question
If an application contains only one method that executes, that method is called the ____________________ method.
Question
In the ____ structure, instructions repeat based on a decision.

A)sequence
C)loop
B)selection
D)flowchart
Question
Arithmetic operators have ____________________ associativity.
Question
In a(n) ____________________ structure, one of two branches of logic is followed based on a decision.
Question
A(n) ____________________ is a basic unit of programming logic.
Question
The ____________________ operator has the lowest precedence.
Question
Program comments are a type of ____________________ documentation.
Question
A(n) ____________________ is a message that asks the user for a response.
Question
A(n) ____________________ variable is not used for input or output.
Question
The equal sign is the ____________________ operator.
Question
An operand that can be used to the right of an operator is a(n) ____________________.
Question
Until a variable is initialized, it holds an unknown value referred to as ____________________.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 2: Applications and Data
1
A(n) ____ is the name of a programming object - for example, a class, method, or variable.

A)convention
C)keyword
B)identifier
D)class header
B
2
You can use named constants to make your programs easier to understand by eliminating ____.

A)constants
C)strings
B)variables
D)magic numbers
D
3
The convention used in this book for named constants is ____ characters ____ underscores to separate words.

A)uppercase, with
C)lowercase, with
B)uppercase, without
D)lowercase, without
A
4
An item's data type defines what operations can be performed on the item.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Which of the following is correct if the data type of inventoryItem is string?

A)inventoryItem = 3
C)inventoryItem = -9
B)inventoryItem = "printer"
D)inventoryItem = (printer)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
Which of the following is correct if the data type for weight is num?

A)weight = 2.75
C)weight = (2.75)
B)weight = "2.75"
D)weight = "heavy"
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
In an interactive program, a ____ enters data.

A)disk
C)user
B)database
D)graphical user interface
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
Three types of program structures are sequence, selection, and loop.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
In echoing input, the program tells the user the desired form of the input data.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
A named constant can be assigned a value multiple times.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
A(n) ____ is a named set of statements that perform some task or group of tasks within an application.

A)method
C)object
B)class
D)flowchart
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
An adjective would be a good choice of identifier for a variable that holds status.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
String values are also called ____ values.

A)unnamed
C)alphabetic
B)digit
D)alphanumeric
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
The assignment operator is said to have right-to-left associativity.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
A loop structure does not contain a decision point.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
A noun would be a good choice for a variable or constant identifier.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
Computers deal with two basic types of data - text and string.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
A literal numeric constant does not change.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
____ constants do not have identifiers like variables do.

A)Alphabetic
C)Unnamed
B)Named
D)Uncertain
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
There will always be only one class ____ for each class.

A)statement
C)header
B)method
D)footer
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
Sequences never include ____.

A)terminations
C)decisions
B)tasks
D)steps
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
What is one drawback to including program comments?

A)They take up too much memory.
C)You cannot use abbreviations.
B)They must be kept current.
D)They make a program difficult to read.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
____________________ are named memory locations with contents that can change.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
What is an advantage of using the practice of echoing input?

A)The program is shorter.
B)Memory usage is lower.
C)There is less chance of syntax errors.
D)The user is more likely to catch input errors.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
The ___ dictate the order in which operations in the same statement are carried out.

A)sequence structures
C)decision points
B)named constants
D)order of operations
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
A ____ dictionary is a list of every variable name used in a program.

A)naming
C)constant
B)string
D)data
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
In the following statement, which operation is done third? answer = a + b + c * d / e - f

A)a+b
C)e-f
B)b+c
D)d/e
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
Most modern programming languages are ____, meaning that you can arrange your lines of code as you see fit.

A)structured
C)formatted
B)columnar
D)free-form
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
A(n) ____ statement stores the value of the right-hand side of the expression in the memory location of the left-hand side.

A)construct
C)equals
B)arithmetic
D)assignment
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
A variable ____________________ is a statement that provides a data type and identifier for a variable.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
With a ____ structure, you perform an action or event, and then you perform the next action in order.

A)loop
C)selection
B)decision
D)sequence
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
What operator has the lowest precedence?

A)+
C)*
B)/
D)=
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
In the following statement, which arithmetic operation is performed first? answer = a + b + c * d / e - f

A)e-f
C)c*d
B)a+b
D)d/e
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
What is an equivalent way to write the following statement? answer = a + b + c * d / e - f

A)answer = a+b+(c*d)/(e-f)
C)answer = a+b+(c*d/e-f)
B)answer = a+b+(c*d)/e-f
D)answer = a+b+c*(d/e)-f
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
A ____________________ constant is enclosed within quotation marks.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
____________________ programs can accept data without human intervention.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
According to the rules of precedence, ____ has higher precedence than addition.

A)multiplication
C)the equals sign
B)subtraction
D)assignment
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
Programmers refer to programs that contain meaningful names as ____.

A)external documentation
C)internally consistent
B)self-documenting
D)applications
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
If an application contains only one method that executes, that method is called the ____________________ method.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
In the ____ structure, instructions repeat based on a decision.

A)sequence
C)loop
B)selection
D)flowchart
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
Arithmetic operators have ____________________ associativity.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
In a(n) ____________________ structure, one of two branches of logic is followed based on a decision.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
A(n) ____________________ is a basic unit of programming logic.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
The ____________________ operator has the lowest precedence.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
Program comments are a type of ____________________ documentation.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
A(n) ____________________ is a message that asks the user for a response.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
A(n) ____________________ variable is not used for input or output.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
The equal sign is the ____________________ operator.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
An operand that can be used to the right of an operator is a(n) ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
Until a variable is initialized, it holds an unknown value referred to as ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.