chapter 5 mis 220

Ace your homework & exams now with Quizwiz!

18. 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. a. test expression b. update expression c. initialization expression d. control expression

a

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

a

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

a

25. The term ____________ is used to describe a file from which data is read. a. input file b. output file c. record file d. recordset

a

28. When you work with a ____________, you process 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

a

31. 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. a. filename extensions b. pragmatic identifiers c. binary indices d. run time signatures

a

34. When you want to read data from a text file, you create a file object using the ____________. a. StreamReader class b. TextReader class c. BufferedReader class d. InputReader class

a

40. You can use the StreamReader class's ____________ method to read a line of text from a file. a. ReadLine b. ReadText c. GetNext d. Read

a

44. A(n) ____________ accumulates a total by adding each number in a series to a variable that holds the sum. a. running total b. numeric tally c. active summary d. dynamic collection

a

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

a

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

a

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

a

60. The numbers generated by the Random class are ____________calculated by a formula. a. pseudorandom numbers b. binary encoded numbers c. algebraic derivatives d. complex variables

a

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

a

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

b

12. The increment operator is ____________. a. -- b. ++ c. -= d. +=

b

13. The decrement operator is ____________. a. += b. -- c. -= d. ++

b

19. 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. a. test expression b. update expression c. initialization expression d. increment expression

b

24. The term ____________ is used to describe a file to which data is written. a. input file b. output file c. record file d. recordset

b

27. A ____________ contains data that cannot be viewed by a text editor (such as NotePad). a. source file b. binary file c. data file d. save file

b

30. Files on disk are identified by a(n) ____________. a. index b. filename c. access number d. binary signature

b

32. A ____________, is an object associated with a specific file and provides a way for the program to work with that file. a. data object b. file object c. Filename class d. referential extension

b

36. A ____________ character is an invisible character that marks the end of a line of text. a. line feed b. newline c. line marker d. startline

b

39. 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. a. # b. @ c. $ d. *

b

45. The ____________ displays a standard Windows Open dialog box. a. Open method b. OpenFileDialog control c. FindFileDialog control d. SelectFile control

b

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

b

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

b

52. The ____________ displays a standard Windows Save As dialog box. a. SaveAs method b. SaveFileDialog control c. Save_File event d. OpenFileDialog control

b

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

b

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

b

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

b

7. The while loop is known as a ____________, which means it tests its condition before performing each iteration. a. posttest loop b. pretest loop c. proactive loop d. preemptive loop

b

11. To ____________ a variable means to decrease its value by 1. a. subtract b. increment c. decrement d. supplement

c

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

c

16. The ____________ is specifically designed for situations requiring a counter variable to control the number of times a loop iterates. a. while loop b. if-else statement c. for loop d. switch statement

c

21. Be careful not to place a statement that modifies the counter variable inside the body of a ____________. a. while loop b. if statement c. for loop d. switch statement

c

22. In the header of a for loop, which expression should not end with a semicolon? a. initialization expression b. test expression c. update expression d. none of these

c

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

c

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

c

35. You can use the StreamWriter class's ____________ method to write a line of text to a file. a. PrintLine b. WriteText c. WriteLine d. PrintText

c

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

c

41. A file's ____________ marks the location of the next item that will be read from the file. a. line marker b. index value c. read position d. newline character

c

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

c

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

c

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

c

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

c

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

c

57. 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()

c

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

c

61. A ____________ is used in the calculation to generate random numbers. a. sentinel b. logarithmic value c. seed value d. Random object

c

8. ____________ are commonly used to control the number of times a loop iterates. a. Boolean variables b. Sentinel variables c. Counter variables d. Named constants

c

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

c

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

c

10. To ____________ a variable means to increase its value by 1. a. append b. decrement c. add d. increment

d

14. When the ++ and -- operators are written after their operands it is called ____________. a. prefix mode b. suffix mode c. appendix mode d. postfix mode

d

17. The first expression appearing in the header of a for loop is the ____________, which usually assigns a starting value to a counter variable. a. update expression b. test expression c. Boolean expression d. initialization expression

d

26. A ____________ contains data that has been encoded as text using a scheme such as ASCII. a. document (as on MS-Word or Open-Document Format) b. spreadsheet (as in Excel) c. binary file d. text file

d

33. In order to write data to a text file, you must create a file object using the ____________. a. TextReader class b. TextWriter class c. StreamReader class d. StreamWriter class

d

37. The ____________ is a method in by the StreamWriter class that writes an string to a text file without writing a newline character. a. Print method b. Text method c. WriteLine method d. Write method

d

4. Each time a loop executes its statement or statements, we say the loop is performing a(n) ____________. a. cycle b. pass c. execution d. iteration

d

43. The variable that accumulates a total of the numbers in a running total is called a(n) ____________. a. counter b. sentinel c. entity d. accumulator

d

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

d


Related study sets

NCLEX Questions-Theories of Growth and Development

View Set