click below
click below
Normal Size Small Size show me how
IST 1551 Final
| Question | Answer |
|---|---|
| C# provides a special loop that, in many circumstances, simplifies array processing. It is known as the ____. | foreach loop |
| The storage locations in an array are known as _____. | elements |
| The foreach loop is designed to work with temporary, read-only variable that is known as the _____. | iteration variable |
| You use the ______ statement to create multiple-alternative decision structure. | switch |
| The ______ section of a switch statement is branched to if none of the case values match the test expression. | default |
| A ListBox's index numbering starts at ______. | zero |
| You can use the _______ property to determine whether an item is selected in a ListBox. | SelectedItem |
| When a(n) _____ is provided for a parameter, it becomes possible to call the method without explicitly passing an argument into the parameter. | default argument |
| When an argument is _____, only a copy of the argument's value is passed. | passed by value |
| When you want a method to be able to change the value of a variable passed to it, the variable must be ______. | passed by reference |
| A method's _____ is the type of value that the method returns. | return type |
| When working with a value type, you are using a variable that holds a piece of data. | True |
| Individual variables are well suited for storing and processing lists of data. | False |
| Arrays are reference type objects. | True |
| You can store a mixture of data types in an array. | False |
| When you create a numeric array in C#, its elements are set to zero by default. | True |
| The subscript of the last element is always one less than the array's Length property. | True |
| What is meant by the term conditionally executed? | A statement executed only when a certain condition is true. |
| What structure us used to test a condition and execute different statements if true or false? | A dual alternative decision structure (if-else statement) |
| Describe how the && operator works? | Both Boolean expressions must be true for the compound expression to be true. |
| Describe how the || operator works. | Only one subexpression must be true; it doesn't matter which. |
| Which logical operator is best for determining whether a number is inside a range? | The && operator. |
| What is a flag and how does it work? | A variable that signals when a condition exists- false means it does not exist, true means it does. |
| What are the two arguments passed to a TryParse method? | 1) the string to convert, and (2) the variable to store the the converted value. |
| How do you determine if a RadioButton or CheckBox is selected? | By checking its Boolean Checked property. |
| How do you add items to a ListBox using the Properties window? | Select control > items property > ellipsis (...) > enter values > OK. |
| How do you read a selected item without causing an exception if none is selected? | Check if SelectedIndex != -1 before accessing SelectedItem. |
| What is contained in the body of a loop? | Statements executed while the Boolean expression is true. |
| Write a postfix increment of count. | count++; |
| How many iterations occur if a for loop's test is false initially? | zero |
| What are filename extensions? | Characters after the period indicating file type. |
| When an input file is opened, what is its initial read position? | The first item. |
| How can you read all items in a file without knowing how many? | Use a loop that runs while EndOfStream is false. |
| What is a variable used to accumulate a total called? | An accumulator. |
| How do you specify a different initial directory for an Open dialog? | Set the InitialDirectory property. |
| Why is the system time preferred as a Random seed? | It is unique and changes rapidly. |
| What code belongs in the Load event? | Setup operations. |
| What naming convention is used for C# methods? | PascalCase-distinguishes them from variables. |
| What us another name for top-down design? | Stepwise refinement. |
| What is a parameter list? | The parameter variable declarations of a method. |
| How do you specify a named argument? | parameterName: value. |
| How are output parameters different from reference parameters? | Output parameters may be uninitialized and must be set before the method ends. |
| How is a value-returning method like a void method? How is it different? | Similar structure; different because a return type and return statement are required. |
| How much memory is allocated for a value type variable? | Enough memory for that variable, allocated by the compiler. |
| What type of variable is needed to work with an object? | A reference type variable. |
| What two steps are needed to create a reference type object? | Declare a reference variable; create the object. |
| Are variables well suited for processing lists of data? why or why not? | No- each holds only one value. |
| What value is returned by an array's Length property? | The number of elements. |