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
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/39
Play
Full screen (f)
Deck 2: Using Data
1
In C#, += adds the operand on the right to the operand on the left and assigns it to the operand on the left in one step.What is the name for this operator?
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
C
2
When using arithmetic operations with operands of dissimilar types, an automatic conversion of nonconforming operands to a unifying type occurs.What is this conversion process called?
A) implicit cast
B) explicit cast
C) manual cast
D) level cast
A) implicit cast
B) explicit cast
C) manual cast
D) level cast
A
3
You are performing an arithmetic operation and have placed the desired result type in parentheses followed by a variable to be cast with the result.What is this an example of?
A) implicit casting
B) automatic casting
C) intrinsic casting
D) explicit casting
A) implicit casting
B) automatic casting
C) intrinsic casting
D) explicit casting
D
4
The equal sign (=) is the C# assignment operator.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
5
You can concatenate two strings with the plus (+) sign.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
6
What uses curly braces containing a number that indicates the desired position for a variable in a list that follows a string used for formatting purposes?
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 39 flashcards in this deck.
Unlock Deck
k this deck
7
What type of expression has a Boolean value as a result?
A) decrement
B) comparison
C) assignment
D) unifying
A) decrement
B) comparison
C) assignment
D) unifying
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
8
What type of operator can be used to reduce a variable's value by 1 either at time of evaluation, or after it is evaluated, depending on placement?
A) increment operator
B) sub and assign operator
C) add and assign operator
D) decrement operator
A) increment operator
B) sub and assign operator
C) add and assign operator
D) decrement operator
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
9
What data type can be used to hold a series of characters?
A) int
B) string
C) sbyte
D) char
A) int
B) string
C) sbyte
D) char
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
10
An assignment that is made when a variable is declared is known as what?
A) A definition of the variable
B) An allocation of the variable
C) An assignment to the variable
D) An initialization of the variable
A) A definition of the variable
B) An allocation of the variable
C) An assignment to the variable
D) An initialization of the variable
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
11
What is the term for 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 39 flashcards in this deck.
Unlock Deck
k this deck
12
In the C# statement moneyString = someMoney.ToString("F3"), what is "F3" an example of?
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
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
13
What is the name for a series of characters used to control the appearance of text output?
A) A declared namespace
B) A set placeholder
C) A defined format string
D) Carefully placed whitespace
A) A declared namespace
B) A set placeholder
C) A defined format string
D) Carefully placed whitespace
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
14
What type of 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 39 flashcards in this deck.
Unlock Deck
k this deck
15
What data type can be used to hold any single character, including numbers and non-printing characters?
A) char
B) string
C) bool
D) int
A) char
B) string
C) bool
D) int
Unlock Deck
Unlock for access to all 39 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 39 flashcards in this deck.
Unlock Deck
k this deck
17
someValue++ is an example of the use of the prefix increment operator.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
18
What type of number can be described as having varying numbers of significant digits, which 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 39 flashcards in this deck.
Unlock Deck
k this deck
19
How is a Boolean variable declared in a program?
A) A char type variable must be declared, optionally followed by a bool value.
B) A bool type variable must be declared, optionally followed by a bool value.
C) An int type variable must be declared, optionally followed by a bool value.
D) A boolean type variable must be declared, optionally followed by a bool value.
A) A char type variable must be declared, optionally followed by a bool value.
B) A bool type variable must be declared, optionally followed by a bool value.
C) An int type variable must be declared, optionally followed by a bool value.
D) A boolean type variable must be declared, optionally followed by a bool value.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
20
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 39 flashcards in this deck.
Unlock Deck
k this deck
21
What method from the Convert class can be used to convert 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 39 flashcards in this deck.
Unlock Deck
k this deck
22
What happens when "string1" is added to "string2" using the + sign in the C# programming language?
A) The strings are concatenated together.
B) The strings are converted to integer equivalents and then added together.
C) The result is returned as a Boolean value.
D) A type error occurs, and the program is halted.
A) The strings are concatenated together.
B) The strings are converted to integer equivalents and then added together.
C) The result is returned as a Boolean value.
D) A type error occurs, and the program is halted.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
23
What statement regarding operator precedence is accurate?
A) Multiplication, division, and addition always take place prior to the calculation of a remainder.
B) Operations that are placed in parentheses are evaluated first.
C) Operations are always evaluated left to right, regardless of the expressions.
D) Addition and subtraction operations are evaluated first.
A) Multiplication, division, and addition always take place prior to the calculation of a remainder.
B) Operations that are placed in parentheses are evaluated first.
C) Operations are always evaluated left to right, regardless of the expressions.
D) Addition and subtraction operations are evaluated first.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
24
What is a variable declaration, what is its purpose, and what does the declaration include?
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
25
What method can be used to accept user input from the keyboard on the console?
A) Next()
B) NextLine()
C) ReadLine()
D) Input()
A) Next()
B) NextLine()
C) ReadLine()
D) Input()
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
26
What keyword can be used to create a named identifier for a memory location whose contents cannot change?
A) final
B) static
C) const
D) fix
A) final
B) static
C) const
D) fix
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
27
What method can be used as an alternative to the Convert class methods to change a string into 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 39 flashcards in this deck.
Unlock Deck
k this deck
28
What are the three floating-point data types in C#? Briefly describe the characteristics of each type.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
29
When running a program, an instruction to the user to enter data for the program to process is known by what term?
A) line
B) prompt
C) cue
D) hint
A) line
B) prompt
C) cue
D) hint
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
30
What is NOT part of a variable declaration in the C# programming language?
A) The data type the variable will store.
B) The variable's name.
C) An optional assignment operator and assigned value.
D) The variable's associated parent class.
A) The data type the variable will store.
B) The variable's name.
C) An optional assignment operator and assigned value.
D) The variable's associated parent class.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
31
What operator is used for exponentials in the C# programming language?
A) ^
B) %
C) *
D) None of the above.
A) ^
B) %
C) *
D) None of the above.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
32
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 39 flashcards in this deck.
Unlock Deck
k this deck
33
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 39 flashcards in this deck.
Unlock Deck
k this deck
34
What are the differences between the prefix increment operator and postfix increment operator?
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
35
How can you compare strings using the Compare() method?
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
36
Explain why implicit numeric conversions are necessary and how C# chooses operands to convert.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
37
Explain how to use the C# shortcut arithmetic operators -=, *=, and /=.
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck
38
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 39 flashcards in this deck.
Unlock Deck
k this deck
39
What type of program specifically allows and accepts user input?
A) interactive program
B) static program
C) constant program
D) procedural program
A) interactive program
B) static program
C) constant program
D) procedural program
Unlock Deck
Unlock for access to all 39 flashcards in this deck.
Unlock Deck
k this deck