Ch (5-6)

¡Supera tus tareas y exámenes ahora con Quizwiz!

The increment operator is ____________.

++

If you specify a path in a string literal, be sure to prefix the string with the ____________ symbol, also known as the literal text character.

@

If the user clicks the Cancel button, the SaveFileDialog control's ShowDialog method returns the value ____________.

DialogResult.Cancel

If the user clicks the Open button, the OpenFileDialog control's ShowDialog method returns the value ____________.

DialogResult.OK

You can use the StreamReader class's ____________ to determine if the file's read position is at the end of the file.

EndOfStream property

A binary file may be opened and viewed in a text editor such as Notepad

F

A while loop will always iterate at least once, even if the Boolean expression is initially false.

F

An exception will never be thrown when a program attempts to read beyond the end of a file.

F

Counter variables are commonly used to hold Boolean values that control the number of times a loop iterates.

F

If a ListBox is empty, the Items.Count property equals -1.

F

In code, you can display an Open dialog box by calling the OpenFileDialog control's OpenDialog method.

F

In general, there are three types of files: text, binary, and bitmap.

F

In the update expression of a for loop, you must use the ++ operator in the increment expression.

F

The Next method in the Random class generates a floating-point number.

F

The NextDouble method in the Random class generates a value as high as 1.0 X 108

F

The first line of the for loop is known as the loop title.

F

Virtually all operating systems follow the same set of rules for naming files.

F

When a program writes to an output file, a special value known as a translator keeps track of the current position in the file.

F

When keeping a running total, the accumulator variable can start with any value and still contain the correct total when the loop finishes.

F

When you create an OpenFileDialog control, its Filename property is initially set to the directory where the program's executable file is located.

F

When you write a stand-alone statement to increment a variable, the prefix operator is faster than the postfix version.

F

You can change the default text displayed in the Save As dialog box's title bar by changing the SaveFileDialog control's DisplayText property.

F

You can only add values of the string data type to a ListBox control.

F

You can use the WriteLine or Write methods from the StreamReader class to write numbers to a text file.

F

To append data to an existing file, you open it with the ____________ method.

File.AppendText

When the user selects a file with the Open dialog box, the file's path and filename are stored in the control's ____________.

Filename property

You can specify the directory to be initially displayed by the Open dialog box by storing its path in the ____________.

InitialDirectory property

To add an item to a ListBox control with code, you call the control's ____________method.

Items.Add

ListBox controls have an ____________ method that erases all the items in the Items property.

Items.Clear

ListBox controls have an ____________ property that reports the number of items stored in the ListBox.

Items.Count

When you run an application, the application's form is loaded into memory and an event known as the ____________ takes place.

Load event

Once you have created a Random object, you can call its ____________ method to get a random integer number.

Next

You can call a Random object's ____________ method to get a random floating-point number between 0.0 and 1.0.

NextDouble

The ____________ displays a standard Windows Open dialog box.

OpenFileDialog control

The ____________ is useful in applications that must open an existing file because it allows the user to browse the system and select the file.

OpenFileDialog control

The .NET Framework provides a class named ____________ that you can use in C# to generate random numbers.

Random

You can use the StreamReader class's ____________ method to read a line of text from a file.

ReadLine

The ____________ allows the user to browse the system and select a location and name for a file that is about to be saved.

Save As dialog box

The ____________ displays a standard Windows Save As dialog box.

SaveFileDialog control

In code, you can display a Save As dialog box by calling the SaveFileDialog control's ____________ method.

ShowDialog

When you want to read data from a text file, you create a file object using the ____________.

StreamReader class

In order to write data to a text file, you must create a file object using the ____________ class.

StreamWriter

A direct access file is also known as a random access file.

T

A random integer's range will begin at zero unless you specify otherwise.

T

By default, the Open dialog box displays the contents of the user's Documents directory.

T

By default, the word Open is displayed in an Open dialog box's title bar.

T

By indenting the statements in the body of a loop, you visually set the loop body apart from the surrounding code.

T

If a Random object uses the same seed value each time it is created, it always generates the same series of random numbers.

T

If you call Random.Next( N ) where N = 2, the resulting random values will be either 0 or 1.

T

In most circumstances you should avoid writing loops that never-end.

T

In order for a program to work with a file on the computer's disk, the program must create a file object using code statements.

T

Incrementing and decrementing are so commonly done in programs that C# provides the ++ and -- unary operators for just these purposes.

T

It is possible to write a for loop in such a way that it will never iterate.

T

Most programming languages provide two different ways to access data stored in a file: sequential access and direct access.

T

The ++ operator is pronounced "plus plus" and the -- operator is pronounced "minus minus".

T

The SaveFileDialog control displays Save As in the dialog window's title bar.

T

The do-while loop always performs at least one iteration, even if its Boolean expression is false to begin with.

T

The values generated by the Random class are not really random—instead, they are determined by a formula that only makes the number appear as if they were random.

T

The while loop gets its name from the way it works: While a Boolean expression is true, do some task.

T

There are always three steps that must be taken when a file is used by a program: opening the file, processing the file, and then closing the file.

T

To create file objects, you will need to include the using System.IO namespace at the top of your programs.

T

When a variable is declared in the initialization expression of a for loop, the scope of the variable is limited to the loop.

T

When reading numeric data from a text file, the Parse and TryParse methods can be used to convert the items from string values to numeric data types.

T

When working with files, you can write a try-catch statement to handle unexpected errors.

T

You can change the default text displayed in the Open dialog box's title bar by changing the control's ____________.

Title property

The ____________ is a method in by the StreamWriter class that writes an string to a text file without writing a newline character.

Write method

You can use the StreamWriter class's ____________ method to write a line of text to a file.

WriteLine

The variable that accumulates a total of the numbers in a running total is called a(n) ____________.

accumulator

A ____________ contains data that cannot be viewed by a text editor (such as NotePad).

binary file

The statement or block of statements following the while clause is known as the ____________ of the loop.

body

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 ____________.

component tray

To ____________ a variable means to decrease its value by 1.

decrement

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.

direct access file

The ____________ is a post-test loop, which means it performs an iteration before testing its Boolean expression.

do -while loop

A ____________, is an object associated with a specific file and provides a way for the program to work with that file.

file object

Files on disk are identified by a(n) ____________.

filename

Many systems, including MS-Windows, support the use of ____________, which are short sequences of characters that appear at the end of filenames and are preceded by a period.

filename extensions

Be careful not to place a statement that modifies the counter variable inside the body of a ____________.

for loop

The ____________ is specifically designed for situations requiring a counter variable to control the number of times a loop iterates.

for loop

If a loop does not have a way of stopping, it is called a(n) ____________.

infinite loop

The first expression appearing in the header of a for loop is the ____________, which usually assigns a starting value to a counter variable.

initialization expression

The term ____________ is used to describe a file from which data is read.

input file

Each time a loop executes its statement or statements, we say the loop is performing a(n) ____________.

iteration

The expression ____________ causes an object of the Random class to be created in memory.

new Random()

A ____________ character is an invisible character that marks the end of a line of text.

newline

The term ____________ is used to describe a file to which data is written.

output file

When the ++ and -- operators are written after their operands it is called ____________.

postfix mode

Because the for loop tests its Boolean expression before it performs an iteration, it is a ____________.

pre-test loop

The while loop is known as a ____________, which means it tests its condition before performing each iteration.

pre-test loop

The ++ and -- operators can be written before their operands, which is called ____________.

prefix mode

The numbers generated by the Random class are ____________calculated by a formula.

pseudorandom numbers

A file's ____________ marks the location of the next item that will be read from the file.

read position

A(n) ____________ accumulates a total by adding each number in a series to a variable that holds the sum.

running total

A ____________ is used in the calculation to generate random numbers.

seed value

When you work with a ____________, you process data from the beginning of the file to the end of the file.

sequential access file

The second expression appearing in the header of a for loop is the _____________, which is a Boolean expression that determines whether the loop will repeat.

test expression

A ____________ contains data that has been encoded as text using a scheme such as ASCII.

text file

In the header of a for loop, which expression should not end with a semicolon?

update expression

The third expression appearing in the header of a for loop is the ____________, which executes at the end of each iteration. It usually increments the loop's counter variable.

update expression

The ____________ begins with the word while, followed by a Boolean expression that is enclosed in parentheses.

while clause


Conjuntos de estudio relacionados

E2 - Chapter 7 Linear Regression - BADM

View Set

Ch. 18 Iggy Care of Patients with Arthritis and Other Connective Tissue Diseases

View Set

In-group heterogeneity vs out-group homogeneity

View Set

Language Arts 700 - Unit 2: Usage; Speaking and Listening; Verb Tenses TEST: USAGE; SPEAKING AND LISTENING; VERB TENSESThe three intonations are juncture, pitch and

View Set

accounting 202 chapter 4 learnsmart

View Set

5.15.R - Lesson: Act 1 Quick Check

View Set

Spinal Cord Injury Study Questions

View Set

Solving Rate Problems: Assignment

View Set

Chapter 23, High-Risk Newborn: ob

View Set

Nonforfeiture and Settlement Options

View Set

Unit Ten - Miscellaneous Florida Statutes

View Set

Chapter 16 Care of Patients Experiencing Urgent Alterations in Health / FAHN

View Set