Deck 2: Using 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
Match between columns
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/42
Play
Full screen (f)
Deck 2: Using Data
1
You declare a Boolean variable by using type ____.
A) char
B) bool
C) int
D) boolean
A) char
B) bool
C) int
D) boolean
B
2
In the C# statement moneyString = someMoney.ToString("F3") , the expression F3 is an example of a(n) ____.
A) literal constant
B) standard numeric format string
C) named constant
D) intrinsic type
A) literal constant
B) standard numeric format string
C) named constant
D) intrinsic type
B
3
In C#, you use the ____ data type to hold a series of characters.
A) int
B) string
C) sbyte
D) char
A) int
B) string
C) sbyte
D) char
B
4
+= is the C# ____ operator; it adds the operand on the right to the operand on the left and assigns it to the operand on the left in one step.
A) prefix increment
B) postfix increment
C) add and assign
D) increment and assign
A) prefix increment
B) postfix increment
C) add and assign
D) increment and assign
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
5
The equal sign ( = ) is the C# assignment operator.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
6
A(n) ____ arithmetic operator has one argument to the left and another argument to the right of the operator.
A) binary
B) complex
C) composite
D) unary
A) binary
B) complex
C) composite
D) unary
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
7
A(n) ____ is a named location in computer memory that can hold different values at different points in time.
A) variable
B) constant
C) literal constant
D) alias
A) variable
B) constant
C) literal constant
D) alias
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
8
someValue++ is an example of the use of the prefix increment operator.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
9
An expression containing a(n) ____ operator has a Boolean value.
A) decrement
B) comparison
C) assignment
D) unifying
A) decrement
B) comparison
C) assignment
D) unifying
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
10
Operator precedence rules ensure that addition and subtraction always take place prior to multiplication, division, or remainder in an expression.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
11
If a value is given to a variable at the time it is declared, this is called a(n) ____.
A) definition
B) allocation
C) assignment
D) initialization
A) definition
B) allocation
C) assignment
D) initialization
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
12
A ____ is a string of characters that optionally contains fixed text and contains one or more format items or placeholders for variable values.
A) namespace
B) placeholder
C) format string
D) whitespace
A) namespace
B) placeholder
C) format string
D) whitespace
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
13
In arithmetic operations with operands of dissimilar types, a(n) ____ is the automatic conversion of nonconforming operands to a unifying type.
A) implicit cast
B) explicit cast
C) manual cast
D) level cast
A) implicit cast
B) explicit cast
C) manual cast
D) level cast
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
14
You can concatenate two strings with the plus ( + ) sign.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
15
To purposefully override the unifying type in an arithmetic operation, use a(n) ____ by placing the desired result type in parentheses followed by the variable or constant to be cast.
A) implicit cast
B) automatic cast
C) intrinsic cast
D) explicit cast
A) implicit cast
B) automatic cast
C) intrinsic cast
D) explicit cast
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
16
An escape sequence is used to represent special characters such as a carriage return or a tab, and always begins with a backslash.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
17
You use the ____ data type to hold any single character.
A) char
B) string
C) bool
D) int
A) char
B) string
C) bool
D) int
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
18
A ____ consists of a pair of curly braces containing a number that indicates the desired variable's position in a list that follows the string.
A) format string
B) whitespace
C) namespace
D) placeholder
A) format string
B) whitespace
C) namespace
D) placeholder
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
19
A prefix or postfix ____ operator reduces a variable's value by 1.
A) increment
B) sub and assign
C) add and assign
D) decrement
A) increment
B) sub and assign
C) add and assign
D) decrement
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
20
A(n) ____ number is one that contains decimal positions.
A) integer
B) whole
C) floating-point
D) int
A) integer
B) whole
C) floating-point
D) int
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
21
Explain how to use the C# shortcut arithmetic operators -= , *= , and /= .
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
22
How is a named constant different from a variable? How would you create a named constant (and show an example)?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
23
A data item is ____________________ when it cannot be changed after a program is compiled.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
24
Operators are used to manipulate values in a program. For example, in the expression X + Y, + is an operator. The values that operators use, such as X and Y, are called ____________________.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
25
What is a variable declaration, what is its purpose, and what does the declaration include?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
26
How can you compare strings using the Compare() method?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
27
Giving a value to a variable, as in the statement someVariable = 5 , is called a(n) ____________________.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
28
Operators that have only one argument, such as the prefix and postfix increment operators, are called ____________________ operators.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
29
What is an enumeration and what are the advantages of creating an enumeration type? Show an example of an enumeration definition.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
30
What are the differences between the prefix increment operator and postfix increment operator?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
31
As an alternative to the Convert class methods, you can use a(n) ____ method to convert a string to a number.
A) Cast()
B) Parse()
C) Assign()
D) Write()
A) Cast()
B) Parse()
C) Assign()
D) Write()
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
32
You can use the ____ method to accept user input from the keyboard.
A) Next()
B) NextLine()
C) ReadLine()
D) Input()
A) Next()
B) NextLine()
C) ReadLine()
D) Input()
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
33
An instruction to the user to enter data is called a ____.
A) line
B) prompt
C) cue
D) hint
A) line
B) prompt
C) cue
D) hint
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
34
What are the three floating-point data types in C#? Briefly describe the characteristics of each type.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
35
The ____ method from the Convert class converts a specified value to an 8-bit unsigned integer.
A) ToDecimal()
B) ToSingle()
C) ToInt16()
D) ToByte()
A) ToDecimal()
B) ToSingle()
C) ToInt16()
D) ToByte()
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
36
A program that accepts console input from the user is a(n) ____ program.
A) interactive
B) static
C) constant
D) better
A) interactive
B) static
C) constant
D) better
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
37
Explain why implicit numeric conversions are necessary and how C# chooses operands to convert.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
38
The keyword ____ is used to declare a named constant.
A) final
B) static
C) const
D) fix
A) final
B) static
C) const
D) fix
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
39
What are the nine integral data types in C# and how do you decide which is the most appropriate to use in a particular situation?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
40
The number of significant digits in a floating point number specifies the mathematical accuracy of the value. A(n) ____________________ data type can hold up to 16 significant digits of accuracy.
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
41
Match between columns
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck
42
What is the purpose of the ReadLine() method? How would you use it with a variable of type string ? How would you use it with a variable of type double ?
Unlock Deck
Unlock for access to all 42 flashcards in this deck.
Unlock Deck
k this deck