Deck 5: Loops, Files, and Random Numbers

Full screen (f)
exit full mode
Question
The decrement operator is ____________.

A) +=
B) --
C) -=
D) ++
Use Space or
up arrow
down arrow
to flip the card.
Question
The ____________ is specifically designed for situations requiring a counter variable to control the number of times that a loop iterates.

A) while loop
B) if-else statement
C) for loop
D) switch statement
Question
Each time the loop executes its statement or statements, we say the loop is iterating, or performing a(n) ____________.

A) cycle
B) pass
C) execution
D) iteration
Question
____________ are commonly used to control the number of times that a loop iterates.

A) Boolean variables
B) Sentinel variables
C) Counter variables
D) Named constants
Question
The ____________ begins with the word while, followed by a Boolean expression that is enclosed in parentheses.

A) conditional statement
B) logic mark
C) while clause
D) loop parameter
Question
To ____________ a variable means to increase its value.

A) append
B) decrement
C) add
D) increment
Question
The third expression that appears in the loop header of the for loop is the ____________, which executes at the end of each iteration, and it is typically the statement that increments the loop's counter variable.

A) test expression
B) update expression
C) initialization expression
D) increment expression
Question
The first expression that appears in the loop header of the for loop is the ____________, which is normally used to initialize a counter variable to its starting value.

A) update expression
B) test expression
C) Boolean expression
D) Initialization expression
Question
ListBox controls have an ____________ method that erases all the items in the Items property.

A) Items.Erase
B) Items.Remove
C) Items.Clear
D) Items.Reset
Question
Because the for loop tests its Boolean expression before it performs an iteration, it is a ____________.

A) pretest loop
B) pseudo loop
C) posttest loop
D) infinite loop
Question
The statement or block of statements following the while clause is known as the ____________ of the loop.

A) assembly
B) body
C) definition
D) sequence structure
Question
When the ++ and -- operators are written after their operands it is called ____________.

A) prefix mode
B) suffix mode
C) appendix mode
D) postfix mode
Question
ListBox controls have an ____________ property that reports the number of items stored in the ListBox.

A) Items.Count
B) Items.Size
C) Items.List
D) Items.Contains
Question
To ____________ a variable means to decrease its value.

A) subtract
B) increment
C) decrement
D) supplement
Question
The ++ and -- operators can be written before their operands, which is called ____________.

A) preface mode
B) postfix mode
C) prefix mode
D) superscript mode
Question
The while loop is known as a ____________, which means it tests its condition before performing an iteration.

A) posttest loop
B) pretest loop
C) proactive loop
D) preemptive loop
Question
If a loop does not have a way of stopping, it is called a(n) ____________.

A) runaway loop
B) game loop
C) infinite loop
D) expressionless loop
Question
To add an item to a ListBox control with code, you call the control's ____________method.

A) Add.Items
B) Items.Add
C) Items.Append
D) Items.Insert
Question
The increment operator is ____________.

A) --
B) ++
C) -=
D) +=
Question
The second expression that appears in the loop header of the for loop is the _____________, which is a Boolean expression that controls the execution of the loop.

A) test expression
B) update expression
C) initialization expression
D) control expression
Question
The ____________ is a posttest loop, which means it performs an iteration before testing its Boolean expression.

A) for loop
B) while loop
C) do-while loop
D) do-before loop
Question
A ____________ is an invisible character that specifies the end of a line of text.

A) line feed character
B) newline character
C) carriage return character
D) null character
Question
When you want to read data from a text file, you create a file object using the ____________.

A) StreamReader class
B) TextReader class
C) StreamWriter class
D) TextWriter class
Question
In the loop header of the for loop, which expression should not end with a semicolon?

A) initialization expression
B) test expression
C) update expression
D) none of these
Question
When you want to write data to a text file, you create a file object using the ____________.

A) TextReader class
B) TextWriter class
C) StreamReader class
D) StreamWriter class
Question
The term ____________ is used to describe a file from which data is read.

A) input file
B) output file
C) data file
D) record
Question
You can use the StreamWriter class's ____________ to write a line of text to a file.

A) PrintLine method
B) WriteText method
C) WriteLine method
D) PrintText method
Question
When you work with a ____________, you access data from the beginning of the file to the end of the file.

A) sequential access file
B) direct access file
C) text file
D) input file
Question
To append data to an existing file, you open it with the ____________ method.

A) File.Append
B) File.AppendAll
C) File.AppendText
D) File.OpenExistingText
Question
When you work with a ____________, you can jump directly to any piece of data in the file without reading the data that comes before it.

A) file object
B) binary file
C) direct access file
D) sequential access file
Question
A ____________ contains data that has not been converted to text.

A) source file
B) binary file
C) data file
D) save file
Question
A ____________ contains data that has been encoded as text using a scheme such as Unicode.

A) document
B) spreadsheet
C) binary file
D) text file
Question
Be careful not to place a statement that modifies the counter variable in the body of the ____________.

A) while loop
B) if statement
C) for loop
D) switch statement
Question
If you specify a path in a string literal, be sure to prefix the string with the ____________ character.

A) #
B) @
C) $
D) *
Question
The term ____________ is used to describe a file to which data is written.

A) input file
B) output file
C) data file
D) record
Question
You can use the StreamReader class's ____________ to read a line of text from a file.

A) ReadLine method
B) ReadText method
C) GetNext method
D) Read method
Question
Files on disk are identified by a(n) ____________.

A) index
B) filename
C) access number
D) binary signature
Question
Many systems, including Windows, support the use of ____________, which are short sequences of characters that appear at the end of a filename and are preceded by a period.

A) filename extensions
B) pragmatic identifiers
C) binary indices
D) run time signatures
Question
The ____________ is a method provided by the StreamWriter class that writes an item of data to a text file without writing a newline character.

A) Print method
B) Text method
C) WriteLine method
D) Write method
Question
A ____________, is an object that is associated with a specific file and provides a way for the program to work with that file.

A) file instance
B) file object
C) filename class
D) referential extension
Question
The ____________ displays a standard Windows Save As dialog box.

A) SaveAs method
B) SaveFileDialog control
C) Save_File event
D) OpenFileDialog control
Question
The ____________ allows the user to browse the system and select a location and name for a file that is about to be saved.

A) Save As dialog box
B) Save File dialog box
C) Select Source dialog box
D) Open dialog box
Question
The .NET Framework provides a class named ____________ that you can use in C# to generate random numbers.

A) Rand
B) Random
C) GenNum
D) RandomGenerator
Question
If the user clicks the Open button, the OpenFileDialog control's ShowDialog method returns the value ____________.

A) Result.True
B) DialogResult.OK
C) DialogResult.Open
D) Result.OpenFile
Question
The expression ____________ causes an object of the Random class to be created in memory.

A) GetRandom(int)
B) GenerateRandom(number)
C) new Random()
D) random new()
Question
The variable that is used to accumulate the total of the numbers in a running total is called a(n) ____________.

A) counter
B) sentinel
C) entity
D) accumulator
Question
You can change the default text displayed in the Open dialog box's title bar by changing the control's ____________.

A) Caption property
B) Text property
C) Title property
D) Heading property
Question
Once you have created a Random object, you can call its ____________ method to get a random integer number.

A) Next
B) GetInteger
C) GenerateNumber
D) NextInteger
Question
When the user selects a file with the Open dialog box, the file's path and filename are stored in the control's ____________.

A) FilePath property
B) Source property
C) Location property
D) Filename property
Question
A file's ____________ marks the location of the next item that will be read from the file.

A) bit count
B) index value
C) read position
D) newline character
Question
The numbers that are generated by the Random class are ____________that are calculated by a formula.

A) pseudorandom numbers
B) binary encoded numbers
C) algebraic derivatives
D) complex variables
Question
You can use the StreamReader class's ____________ to determine if the file's read position is at the end of the file.

A) EndOfFile property
B) StreamEnd method
C) EndOfStream property
D) EOF method
Question
When controls such as the OpenFileDialog and SaveFileDialog are created they do not appear on the form, but in an area at the bottom of the Designer known as the ____________.

A) control overflow
B) design space
C) component tray
D) virtual form
Question
In code, you can display a Save As dialog box by calling the SaveFileDialog control's ____________ method.

A) SaveAs
B) Show
C) ShowDialog
D) Display
Question
You can specify the directory to be initially displayed by the Open dialog box by storing its path in the ____________.

A) InitialDirectory property
B) Source property
C) Filename property
D) Path property
Question
The ____________ displays a standard Windows Open dialog box.

A) Open method
B) OpenFileDialog control
C) SaveFileDialog control
D) component tray
Question
You can call a Random object's ____________ method to get a random floating-point number between 0.0 and 1.0.

A) GetDouble
B) NextFloat
C) NextDouble
D) DoubleRand
Question
The ____________ is useful in applications that must open an existing file because it allows the user to browse the system and select the file.

A) File.OpenText method
B) OpenFileDialog control
C) Open dialog box
D) Windows Explorer
Question
A(n) ____________ accumulates a total by adding each number in a series as they are read from a file.

A) running total
B) numeric tally
C) active summary
D) dynamic collection
Question
If the user clicks the Cancel button, the SaveFileDialog control's ShowDialog method returns the value ____________.

A) Result.False
B) DialogResult.Cancel
C) DialogResult.Abort
D) Result.NULL
Question
A ____________ is used in the calculation to generate random numbers.

A) sentinel
B) logarithmic value
C) seed value
D) Random object
Question
Incrementing a decrementing is so commonly done in programs that C# provides a set of simple unary operators designed just for incrementing a decrementing variables.
Question
When you run an application, the application's form is loaded into memory and an event known as the ____________ takes place.

A) Load event
B) Launch event
C) Boot event
D) Initialization event
Question
You can only add values of the string data type to a ListBox control.
Question
Not only may the counter variable of a for loop be initialized in the initialization expression, but it may also be declared there.
Question
By indenting the statements in the body of the loop, you visually set the apart from the surrounding code.
Question
It is possible to write a for loop in such a way that it will never iterate.
Question
The while loop gets its name from the way it works: While a Boolean expression is true, do some task.
Question
In the update expression of a for loop, it is required to use the ++ operator in the increment expression.
Question
In a count-controlled loop, you can only decrement the counter variable.
Question
When a variable is declared in the initialization expression of a for loop, the scope of the variable is limited to the loop.
Question
If you are writing a while loop that has only one statement in its body, you do not have enclose the statement inside curly braces.
Question
If the ListBox is empty, the Items.Count property equals -1.
Question
The do-while loop always performs at least one iteration, even if its Boolean expression is false to begin with.
Question
In most circumstances you should avoid writing infinite loops.
Question
Counter variables are commonly used to hold Boolean values that control the number of times that a loop iterates.
Question
The first line of the for loop is known as the loop title.
Question
The ++ operator is pronounced "plus plus" and the -- operator is pronounced "minus minus".
Question
When you write a simple statement to increment or decrement a variable, it doesn't matter if you use prefix mode or postfix mode.
Question
An important characteristic of the while loop is that the loop will always iterate at least once, even if the Boolean expression is false to start with.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/109
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 5: Loops, Files, and Random Numbers
1
The decrement operator is ____________.

A) +=
B) --
C) -=
D) ++
B
2
The ____________ is specifically designed for situations requiring a counter variable to control the number of times that a loop iterates.

A) while loop
B) if-else statement
C) for loop
D) switch statement
C
3
Each time the loop executes its statement or statements, we say the loop is iterating, or performing a(n) ____________.

A) cycle
B) pass
C) execution
D) iteration
D
4
____________ are commonly used to control the number of times that a loop iterates.

A) Boolean variables
B) Sentinel variables
C) Counter variables
D) Named constants
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
5
The ____________ begins with the word while, followed by a Boolean expression that is enclosed in parentheses.

A) conditional statement
B) logic mark
C) while clause
D) loop parameter
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
6
To ____________ a variable means to increase its value.

A) append
B) decrement
C) add
D) increment
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
7
The third expression that appears in the loop header of the for loop is the ____________, which executes at the end of each iteration, and it is typically the statement that increments the loop's counter variable.

A) test expression
B) update expression
C) initialization expression
D) increment expression
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
8
The first expression that appears in the loop header of the for loop is the ____________, which is normally used to initialize a counter variable to its starting value.

A) update expression
B) test expression
C) Boolean expression
D) Initialization expression
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
9
ListBox controls have an ____________ method that erases all the items in the Items property.

A) Items.Erase
B) Items.Remove
C) Items.Clear
D) Items.Reset
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
10
Because the for loop tests its Boolean expression before it performs an iteration, it is a ____________.

A) pretest loop
B) pseudo loop
C) posttest loop
D) infinite loop
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
11
The statement or block of statements following the while clause is known as the ____________ of the loop.

A) assembly
B) body
C) definition
D) sequence structure
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
12
When the ++ and -- operators are written after their operands it is called ____________.

A) prefix mode
B) suffix mode
C) appendix mode
D) postfix mode
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
13
ListBox controls have an ____________ property that reports the number of items stored in the ListBox.

A) Items.Count
B) Items.Size
C) Items.List
D) Items.Contains
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
14
To ____________ a variable means to decrease its value.

A) subtract
B) increment
C) decrement
D) supplement
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
15
The ++ and -- operators can be written before their operands, which is called ____________.

A) preface mode
B) postfix mode
C) prefix mode
D) superscript mode
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
16
The while loop is known as a ____________, which means it tests its condition before performing an iteration.

A) posttest loop
B) pretest loop
C) proactive loop
D) preemptive loop
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
17
If a loop does not have a way of stopping, it is called a(n) ____________.

A) runaway loop
B) game loop
C) infinite loop
D) expressionless loop
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
18
To add an item to a ListBox control with code, you call the control's ____________method.

A) Add.Items
B) Items.Add
C) Items.Append
D) Items.Insert
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
19
The increment operator is ____________.

A) --
B) ++
C) -=
D) +=
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
20
The second expression that appears in the loop header of the for loop is the _____________, which is a Boolean expression that controls the execution of the loop.

A) test expression
B) update expression
C) initialization expression
D) control expression
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
21
The ____________ is a posttest loop, which means it performs an iteration before testing its Boolean expression.

A) for loop
B) while loop
C) do-while loop
D) do-before loop
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
22
A ____________ is an invisible character that specifies the end of a line of text.

A) line feed character
B) newline character
C) carriage return character
D) null character
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
23
When you want to read data from a text file, you create a file object using the ____________.

A) StreamReader class
B) TextReader class
C) StreamWriter class
D) TextWriter class
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
24
In the loop header of the for loop, which expression should not end with a semicolon?

A) initialization expression
B) test expression
C) update expression
D) none of these
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
25
When you want to write data to a text file, you create a file object using the ____________.

A) TextReader class
B) TextWriter class
C) StreamReader class
D) StreamWriter class
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
26
The term ____________ is used to describe a file from which data is read.

A) input file
B) output file
C) data file
D) record
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
27
You can use the StreamWriter class's ____________ to write a line of text to a file.

A) PrintLine method
B) WriteText method
C) WriteLine method
D) PrintText method
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
28
When you work with a ____________, you access data from the beginning of the file to the end of the file.

A) sequential access file
B) direct access file
C) text file
D) input file
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
29
To append data to an existing file, you open it with the ____________ method.

A) File.Append
B) File.AppendAll
C) File.AppendText
D) File.OpenExistingText
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
30
When you work with a ____________, you can jump directly to any piece of data in the file without reading the data that comes before it.

A) file object
B) binary file
C) direct access file
D) sequential access file
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
31
A ____________ contains data that has not been converted to text.

A) source file
B) binary file
C) data file
D) save file
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
32
A ____________ contains data that has been encoded as text using a scheme such as Unicode.

A) document
B) spreadsheet
C) binary file
D) text file
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
33
Be careful not to place a statement that modifies the counter variable in the body of the ____________.

A) while loop
B) if statement
C) for loop
D) switch statement
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
34
If you specify a path in a string literal, be sure to prefix the string with the ____________ character.

A) #
B) @
C) $
D) *
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
35
The term ____________ is used to describe a file to which data is written.

A) input file
B) output file
C) data file
D) record
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
36
You can use the StreamReader class's ____________ to read a line of text from a file.

A) ReadLine method
B) ReadText method
C) GetNext method
D) Read method
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
37
Files on disk are identified by a(n) ____________.

A) index
B) filename
C) access number
D) binary signature
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
38
Many systems, including Windows, support the use of ____________, which are short sequences of characters that appear at the end of a filename and are preceded by a period.

A) filename extensions
B) pragmatic identifiers
C) binary indices
D) run time signatures
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
39
The ____________ is a method provided by the StreamWriter class that writes an item of data to a text file without writing a newline character.

A) Print method
B) Text method
C) WriteLine method
D) Write method
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
40
A ____________, is an object that is associated with a specific file and provides a way for the program to work with that file.

A) file instance
B) file object
C) filename class
D) referential extension
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
41
The ____________ displays a standard Windows Save As dialog box.

A) SaveAs method
B) SaveFileDialog control
C) Save_File event
D) OpenFileDialog control
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
42
The ____________ allows the user to browse the system and select a location and name for a file that is about to be saved.

A) Save As dialog box
B) Save File dialog box
C) Select Source dialog box
D) Open dialog box
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
43
The .NET Framework provides a class named ____________ that you can use in C# to generate random numbers.

A) Rand
B) Random
C) GenNum
D) RandomGenerator
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
44
If the user clicks the Open button, the OpenFileDialog control's ShowDialog method returns the value ____________.

A) Result.True
B) DialogResult.OK
C) DialogResult.Open
D) Result.OpenFile
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
45
The expression ____________ causes an object of the Random class to be created in memory.

A) GetRandom(int)
B) GenerateRandom(number)
C) new Random()
D) random new()
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
46
The variable that is used to accumulate the total of the numbers in a running total is called a(n) ____________.

A) counter
B) sentinel
C) entity
D) accumulator
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
47
You can change the default text displayed in the Open dialog box's title bar by changing the control's ____________.

A) Caption property
B) Text property
C) Title property
D) Heading property
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
48
Once you have created a Random object, you can call its ____________ method to get a random integer number.

A) Next
B) GetInteger
C) GenerateNumber
D) NextInteger
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
49
When the user selects a file with the Open dialog box, the file's path and filename are stored in the control's ____________.

A) FilePath property
B) Source property
C) Location property
D) Filename property
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
50
A file's ____________ marks the location of the next item that will be read from the file.

A) bit count
B) index value
C) read position
D) newline character
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
51
The numbers that are generated by the Random class are ____________that are calculated by a formula.

A) pseudorandom numbers
B) binary encoded numbers
C) algebraic derivatives
D) complex variables
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
52
You can use the StreamReader class's ____________ to determine if the file's read position is at the end of the file.

A) EndOfFile property
B) StreamEnd method
C) EndOfStream property
D) EOF method
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
53
When controls such as the OpenFileDialog and SaveFileDialog are created they do not appear on the form, but in an area at the bottom of the Designer known as the ____________.

A) control overflow
B) design space
C) component tray
D) virtual form
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
54
In code, you can display a Save As dialog box by calling the SaveFileDialog control's ____________ method.

A) SaveAs
B) Show
C) ShowDialog
D) Display
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
55
You can specify the directory to be initially displayed by the Open dialog box by storing its path in the ____________.

A) InitialDirectory property
B) Source property
C) Filename property
D) Path property
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
56
The ____________ displays a standard Windows Open dialog box.

A) Open method
B) OpenFileDialog control
C) SaveFileDialog control
D) component tray
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
57
You can call a Random object's ____________ method to get a random floating-point number between 0.0 and 1.0.

A) GetDouble
B) NextFloat
C) NextDouble
D) DoubleRand
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
58
The ____________ is useful in applications that must open an existing file because it allows the user to browse the system and select the file.

A) File.OpenText method
B) OpenFileDialog control
C) Open dialog box
D) Windows Explorer
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
59
A(n) ____________ accumulates a total by adding each number in a series as they are read from a file.

A) running total
B) numeric tally
C) active summary
D) dynamic collection
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
60
If the user clicks the Cancel button, the SaveFileDialog control's ShowDialog method returns the value ____________.

A) Result.False
B) DialogResult.Cancel
C) DialogResult.Abort
D) Result.NULL
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
61
A ____________ is used in the calculation to generate random numbers.

A) sentinel
B) logarithmic value
C) seed value
D) Random object
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
62
Incrementing a decrementing is so commonly done in programs that C# provides a set of simple unary operators designed just for incrementing a decrementing variables.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
63
When you run an application, the application's form is loaded into memory and an event known as the ____________ takes place.

A) Load event
B) Launch event
C) Boot event
D) Initialization event
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
64
You can only add values of the string data type to a ListBox control.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
65
Not only may the counter variable of a for loop be initialized in the initialization expression, but it may also be declared there.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
66
By indenting the statements in the body of the loop, you visually set the apart from the surrounding code.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
67
It is possible to write a for loop in such a way that it will never iterate.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
68
The while loop gets its name from the way it works: While a Boolean expression is true, do some task.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
69
In the update expression of a for loop, it is required to use the ++ operator in the increment expression.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
70
In a count-controlled loop, you can only decrement the counter variable.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
71
When a variable is declared in the initialization expression of a for loop, the scope of the variable is limited to the loop.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
72
If you are writing a while loop that has only one statement in its body, you do not have enclose the statement inside curly braces.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
73
If the ListBox is empty, the Items.Count property equals -1.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
74
The do-while loop always performs at least one iteration, even if its Boolean expression is false to begin with.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
75
In most circumstances you should avoid writing infinite loops.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
76
Counter variables are commonly used to hold Boolean values that control the number of times that a loop iterates.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
77
The first line of the for loop is known as the loop title.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
78
The ++ operator is pronounced "plus plus" and the -- operator is pronounced "minus minus".
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
79
When you write a simple statement to increment or decrement a variable, it doesn't matter if you use prefix mode or postfix mode.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
80
An important characteristic of the while loop is that the loop will always iterate at least once, even if the Boolean expression is false to start with.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 109 flashcards in this deck.