Deck 2: Applications and Data
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/50
Play
Full screen (f)
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
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
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)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)
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"
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
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
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
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
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
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
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.
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.
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
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
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
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
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
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
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)=
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
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
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
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
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
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