ISYS 3393 Test 2

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

off-by-one

A common problem associated with counter-controlled loops is not executing the loop for the last value. This type of problem is labeled a(n) ____ error.

if (salary < 100000) bonus == 5000;

A company issues $5,000.00 bonuses at the end of the year to all employees who earn less than $100,000. Salary and bonus are both defined as double data types. Which of the following selection statements would assign the correct amount to bonus?

recursive

A method that calls itself repeatedly until it arrives at the solution is a(n) ____method.

delegate

An instance of the delegate class is called a(n) ____.

true

An interpretation of the while statement is "while the condition is true, perform statement(s)". T or F?

verbatim string label

C# has two types of string literals: quoted literals (" ") and @-quoted string literals ("@"). The @-quoted string literals are called ____.

methods

Event handlers are ____.

99

Given an array declared to hold 100 values, the largest index that can be used with the array is:

num [ 0 , 0 ] = 50;

If an array named num is dimensioned to hold 10 values in 5 rows and 2 columns, how would you store 50 in the first physical row and first physical column?

num[4] = 50;

If an array named num is dimensioned to hold 10 values, how would you store 50 in the 5th physical location?

A runtime error will be generated

If an array named num is dimensioned to hold 10 values, what happens if you write num[100] = 50;?

large enough to hold the maximum number of entries

If you do not know how many entries will be stored with the array, you could dimension it ____.

requires that you increment acounter as values are entered so that you know how many elements are stored in your array

If you do not know the size of the array needed, you can create an array large enough to hold any number of entries and tell users to enter a predetermined sentinel value after they enter the last value. Using this approach:

program statements can be written to reference it

It is important to name the button object, because once named ____.

an int representing the number of values currently stored in the array

One of the special properties in the ArrayList class is Count. It returns ____.

True

The Items, SelectedItems, and SelectedIndices properties are useful for retrieving selected items from the ListBox object. T or F?

Focus()

The ____ method of the Control class sets the input focus.

==

The equality operator in C# is ____.

handles the repetition for you

The event-driven model used to create Windows applications ____.

&& and II

The logical operators in C# are ____.

foreach

The loop control structure used to move through a collection (group of data items) that does not require you to increment a loop control variable or test the expression to determine when all data has been processed is the ____ statement.

GetRange( )

The method ____ of the ArrayList class returns an arraylist that is a subset of another arraylist.

Remove( )

The method that deletes a number of characters beginning at a specified position is ____.

wiring an event

The process that includes identifying an event, such as a button click as being of interest, and associating a method to be executed when the event occurs describes ____.

true

The string class stores an immutable series of characters--meaning once you assign a string reference a value, that referenced location's value cannot be modified. T or F?

int [] anArray = new int [10] {100, 100, 100};

There are several ways to do a compile-time initialization of arrays. All of the following are valid ways EXCEPT ____.

in [ ] anArray = new int [10] {{100, 100, 100} {100, 100, 100}};

There are several ways to do a compile-time initialization of two-dimensional arrays. All of the following are valid ways EXCEPT ____.

before the loop body

To "prime the read" with a loop, you place an input statement ____.

int [ ] examScore = new examScore[4];

To declare and instantiate memory for 4 exam scores that range in value from 0 to 100, the following declaration could be made ____.

Text

To retrieve data from a ListBox control as string data, use the ____ property.

both arrays reference the same memory locations

What happens when you assign one array to another using the assignment operator?

CheckedChanged()

What is the name of the default event handler method for RadioButton and CheckBox objects?

switch statement

When a single variable may need to be tested for five different values, the most readable solution would be a(n) ____.

queue

Which class represents a First-In-First-Out (FIFO) collection, which is useful for storing objects in the order they were received for sequential processing?

GroupBox

Which control is used for placing objects, like RadioButtons, together? This control not only offers the benefit of visual appearance, but also helps during design because you can set properties that impact all the associated objects.

all of the above

Which of the following is an example of a collection class?

they are used to block three or more statements

Which of the following statements regarding curly braces is NOT correct as they relate to their use with an if statement?

performed as long as the conditional expression evaluates to true

With the while loop, the body of the loop is ____.

linked lists

____ are types of data structures that consist of a sequence of data records such that in each record there is an additional field that contains a reference (i.e., a link) to the next record in the sequence.

Clone( )

____ creates a copy of the array and returns it as an object?

CheckBox

____ objects usually appear as small boxes that allow users to make a yes/no selection.

sentinel-controlled loop

____________ loops are often used for inputting data when you do not know the exact number of values to be entered.

true

double [ ] price = new double [ ] {3, 2.2, 4.7, 6.1, 4}; Looking above, the value of price.Length is 5. T or F?

5

for (int i = 0; i < 5; i++) Console.Write(i + "\t"); Given the code snippet above, how many times will the loop body be executed?

result is assigned largest

if (aValue < largest ) result = aValue; else result = largest; What happens when aValue is equal to largest in the program segment above?

one-way if statement

if (examScore > 89)grade = 'A'; The expression above is considered a(n) ____.

conditional expression

if (examScore is less than 50)display message "Do better on next exam" In the statement above, the entry inside the parentheses is called the ____.

true or false

if (examScore is less than 50)display message "Do better on next exam" The result of the expression above is ____.

-(value1)

if (value1 > value2) largestOne = value1; else if (value1 < value2) largestOne = value2; else largestOne = -(value1); Using the nested if program statements, assuming value1 is 100 and value2 is 100, what is stored in largestOne above?

0

int counter = 0; while (counter < 100) { Console.WriteLine(counter);counter++; } The first value printed with the program segment above is ____.


Set pelajaran terkait

Chapter 29: Sedative-Hypnotic Drugs

View Set

C++ Chapter 13: Overloading and Templates

View Set

Terrorism and National Security EXAM 1 Study

View Set

AP Economics- Micro- Unit 3 Review

View Set

Global Economics for Managers - Chapter 13-17 Review

View Set

Ch. 8 Government and Not for Profit Accounting Exam 2

View Set