"); document.writeln("Name: " + studentName + "
"); document.write("Score: " + numCorrect + " / " + numPossible + " (" + scorePercent + "%)"); if (numSubjective > 0) { document.write("     [" + numSubjective + " subjective "); if (numSubjective == 1) document.write("question"); else document.write("questions"); document.write(" not graded]"); } document.writeln("

"); document.writeln("
" + titleString + "

"); document.writeln(""); currentInstruction = 0; currentNarrative = 0; for (i=0; i < numQuestions; ++i) { if (currentInstruction < numInstructions) { if (instructionIndex[currentInstruction] == i) { document.writeln(""); ++currentInstruction; } } if (currentNarrative < numNarratives) { if (narrativeIndex[currentNarrative] == i) { document.writeln(""); ++currentNarrative; } } document.writeln(""); document.writeln(""); document.writeln(""); document.writeln(""); } document.writeln("

"); document.writeln(instructionText[currentInstruction]); document.writeln("
 
"); document.writeln("
"); document.writeln(narrativeText[currentNarrative]); document.writeln("
 
"); document.writeln("
" + prefixText[i] + "

" + numberText[i] + " 

" + questionText[i]); document.writeln("

"); document.writeln(""); if (listMap.charAt(i) != "1") { document.writeln(""); document.writeln(""); } document.writeln(""); document.writeln(""); if (showNotes) { document.writeln(""); document.writeln(""); } if (showRef) { document.writeln(""); document.writeln(""); } document.writeln("

RESPONSE: 

" + responseText[i] + "

ANSWER: 

" + answerText[i] + "

NOTES: 

" + notesText[i] + "

REF: 

" + refText[i] + "

"); document.writeln("
 
"); document.writeln("
"); document.writeln(""); document.writeln(""); document.write(""); document.writeln("
 
"); document.writeln("Retake Test"); document.write(""); document.writeln("Help"); document.writeln("
"); document.writeln(""); document.writeln("
Hosted by www.Geocities.ws

"); document.close(); return(false); } function GetResponse(answerIndex, answer) { var listIndex; var responseText; if (listMap.charAt(answerIndex) == "1") { listIndex = answer.selectedIndex; responseText = answer.options[listIndex].text; } else responseText = answer.value; return(responseText); } function ScoreAnswer(answerIndex, responseText) { var listIndex; var answerText; answerText = ansMap[answerIndex]; if (qtypeMap.charAt(answerIndex) == "4") return(NumericCompare(responseText, answerText)); else if (qtypeMap.charAt(answerIndex) == "5") return(MultiCompare(responseText, answerText)); else if (responseText.toUpperCase() == answerText.toUpperCase()) return(true); else return(false); } function BuildPrefixText(answerIndex, responseText, isCorrect) { var text; var listIndex; text = "
"
		if (isCorrect)
			text += ""
		else
			text += ""

		if (listMap.charAt(answerIndex) == "1") {
			if (responseText.length == 0)
				responseText = " ";
			text += " " + responseText + " ";
		}

		text += "
" return(text); } function StripSpaces(s) { var len; var i; len = s.length; for (i=len - 1; i >= 0 && s.charAt(i) == " "; --i) len = i; if (len == 0) s = ""; else if (len != s.length) s = s.substring(0, len); return(s); } function TranslateHtmlString(text) { var newText; var replaceString; var position; var length; var breakPos; var skipExtra; var i; newText = ""; position = 0; length = text.length; while (position < length) { skipExtra = 0; breakPos = -1; for (i=position; i < length && breakPos < 0; ++i) { switch(text.charAt(i)) { case '>': replaceString = ">"; breakPos = i; break; case '<': replaceString = "<"; breakPos = i; break; case '&': replaceString = "&"; breakPos = i; break; case '\r': if ((i + 1) < length && text.charAt(i + 1) == '\n') skipExtra = 1; replaceString = "
"; breakPos = i; break; case '\n': replaceString = "
"; breakPos = i; break; case ' ': if ((i + 1 < length) && text.charAt(i + 1) == ' ') { replaceString = " "; breakPos = i; } break; } } if (breakPos < 0) { newText += text.substring(position, length); position = length; } else { if (breakPos > position) newText += text.substring(position, breakPos); newText += replaceString; position = breakPos + 1 + skipExtra; } } return(newText); } function FixMCNotes(notesText, studentText) { var displayText; var searchText; var upperNotes; var charCode; var startIndex; var endIndex; displayText = ""; if (notesText.length > 0) { if (studentText.length > 0) { upperNotes = notesText.toUpperCase(); studentText = studentText.toUpperCase(); charCode = studentText.charCodeAt(0); searchText = "/" + String.fromCharCode(charCode) + "/"; startIndex = upperNotes.indexOf(searchText); if (startIndex >= 0) { startIndex += searchText.length; searchText = "/" + String.fromCharCode(charCode + 1) + "/"; endIndex = upperNotes.indexOf(searchText, startIndex); if (endIndex < startIndex) endIndex = notesText.length; displayText = notesText.substring(startIndex, endIndex); } } if (displayText.length == 0 && notesText.charAt(0) != "http://www.geocities.com/") displayText = notesText; } return(displayText); } function NumericCompare(s1, s2) { var s1Sign; var s2Sign; var tempString; var decimalCount; var decimalPos; var numToDelete; var len; var ch; var i; s1.toUpperCase(); s2.toUpperCase(); if (s1 == s2) return(true); else { s1Sign = 1; s2Sign = 1; tempString = ""; for (i=0; i < s1.length; ++i) { ch = s1.charAt(i); if (ch == "-" && tempString.length == 0) s1Sign = -1; else if ((ch >= "0" && ch <= "9") || ch == ".") tempString += ch; } s1 = tempString; decimalCount = 0; decimalPos = -1; for (i=0; i < s1.length; ++i) { if (s1.charAt(i) == '.') { ++decimalCount; if (decimalPos < 0) decimalPos = i; } } if (decimalCount == 1 && decimalPos >= 0) { len = s1.length; for (i=len - 1; i >= decimalPos; --i) { if (i == decimalPos || s1.charAt(i) == '0') len = i; else break; } if (len < s1.length) s1 = s1.substring(0, len); if (s1.length == 0) s1 = "0"; } numToDelete = 0; for (i=0; i < s1.length; ++i) { if (s1.charAt(i) == "0") ++numToDelete; else break; } if (numToDelete > 0) { if (numToDelete == s1.length) --numToDelete; if (numToDelete > 0) s1 = s1.substring(numToDelete); } ///////////////////////////////////////////// tempString = ""; for (i=0; i < s2.length; ++i) { ch = s2.charAt(i); if (ch == "-" && tempString.length == 0) s2Sign = -1; else if ((ch >= "0" && ch <= "9") || ch == ".") tempString += ch; } s2 = tempString; decimalCount = 0; decimalPos = -1; for (i=0; i < s2.length; ++i) { if (s2.charAt(i) == '.') { ++decimalCount; if (decimalPos < 0) decimalPos = i; } } if (decimalCount == 1 && decimalPos >= 0) { len = s2.length; for (i=len - 1; i >= decimalPos; --i) { if (i == decimalPos || s2.charAt(i) == '0') len = i; else break; } if (len < s2.length) s2 = s2.substring(0, len); if (s2.length == 0) s2 = "0"; } numToDelete = 0; for (i=0; i < s2.length; ++i) { if (s2.charAt(i) == "0") ++numToDelete; else break; } if (numToDelete > 0) { if (numToDelete == s2.length) --numToDelete; if (numToDelete > 0) s2 = s2.substring(numToDelete); } if (s1Sign == s2Sign && s1 == s2) return(true); } return(false); } function MultiCompare(responseText, answerText) { var startIndex; var endIndex; var partialText; responseText = responseText.toUpperCase(); answerText = answerText.toUpperCase(); startIndex = 0; do { endIndex = answerText.indexOf("\r", startIndex); if (endIndex < 0) partialText = answerText.substring(startIndex); else partialText = answerText.substring(startIndex, endIndex); if (responseText == partialText) return(true); startIndex = endIndex + 1; } while (endIndex > 0); return(false); } function FixMTF(f) { var text; var letter; var theList; var listIndex; var number; var i; for (i=0; i < f.length; ++i) { if (f.elements[i].name.indexOf("MTF:") == 0) { number = parseInt(f.elements[i].name.substring(4), 10); theList = f["MTF-" + number + "-1"]; if (theList) { listIndex = theList.selectedIndex; letter = theList.options[listIndex].text; } else letter = ""; text = StripSpaces(f["MTF-" + number + "-2"].value); if (text == "") f.elements[i].value = letter; else f.elements[i].value = letter + "," + text; } } } function AllowReset() { return(window.confirm("Do you want to clear all of your answers?")); } // -->
 
Name: 
 

Chapter 3 Study Guide



Multiple Choice
Identify the letter of the choice that best completes the statement or answers the question.
 

1. 

The first two phases in the program development life cycle are ____.
a.
design and coding
c.
analysis and design
b.
analysis and testing
d.
coding and testing
 

2. 

A given user interface must allow the user to enter any number for a taxpayer’s income; an input area with a ____ is best for this sort of input.
a.
check box
c.
drop-down menu
b.
radio button
d.
text box
 

3. 

One way to indicate an output only area is by using a ____ background for the output area.
a.
gray
c.
yellow
b.
red
d.
light blue
 

4. 

When the New Project dialog box displays, by default, the Visual Basic Projects project type and the ____ template are selected.
a.
Class Library
c.
ASP.NET Web Application
b.
Windows Control Library
d.
Windows Application
 

5. 

A(n) ____ is an attribute of an object or control, such as its background color or the text that displays with it.
a.
method
c.
property
b.
key
d.
icon
 

6. 

A form’s Width property defines the width of the form in ____.
a.
points
c.
units
b.
pixels
d.
indices
 

7. 

A typical PC monitor contains approximately ____ pixels per inch.
a.
72
c.
256
b.
96
d.
526
 

8. 

A(n) ____ can be a control or form in the main work area or any item selected in the Solution Explorer window, including a solution, project, or other file.
a.
method
c.
click
b.
object
d.
property
 

9. 

When a group of properties is collapsed, a ____ displays next to the group category name in the Properties list; clicking it expands the group to display all the properties in that group.
a.
plus symbol
c.
green bullet
b.
minus symbol
d.
key icon
 

10. 

The default value for the Text property is ____, a generic name that Visual Basic .NET assigns when creating the form.
a.
1Form
c.
NewForm
b.
Form
d.
Form1
 

11. 

The ____ property determines whether a user can resize an application window at run time and how other objects on the form, such as the Maximize button, Minimize button, Control Box, Title bar, and Help button, behave or display.
a.
ApplicationWindow
c.
ResizeWindow
b.
Display
d.
FormBorderStyle
 

12. 

____ a control button on the Windows Form sheet adds a default-sized control to the upper-left corner of the form.
a.
Drawing
c.
Double-clicking
b.
Dragging
d.
all of the above
 

13. 

Dragging a control on a form changes the property values of the control’s ____ properties.
a.
Top and Bottom
c.
Bottom and Right
b.
Top and Left
d.
Left and Right
 

14. 

When a user selects a control, the control is said to have ____ and Visual Basic .NET places the insertion point in the control or displays a dotted rectangle around the control on the form.
a.
clarity
c.
precision
b.
focus
d.
orientation
 

15. 

A user can use the ____ key on the keyboard to set the focus on a specific control.
a.
ALT
c.
CTRL
b.
ESC
d.
TAB
 

16. 

The ____ property determines the order in which Visual Basic .NET sets the focus on controls when a user presses the TAB key.
a.
TabIndex
c.
TabFocus
b.
TabOrder
d.
TabControl
 

17. 

The Height property, the Width property, and the ____ property define the position and size of a TextBox control on an application window.
a.
Size
c.
Position
b.
Location
d.
Orientation
 

18. 

The ____ properties determine the range of allowable values for a NumericUpDown control.
a.
Minimum and Maximum
c.
Start Range and End Range
b.
Top and Bottom
d.
Low and High
 

19. 

The ____ property of a control reflects its name.
a.
Name
c.
Identity
b.
What
d.
Title
 

20. 

Events trigger event ____, which are groups of code statements, sometimes simply called code.
a.
methods
c.
procedures
b.
properties
d.
assignments
 

21. 

A(n) ____ statement is a code statement that changes the value of a variable or property of an object or control.
a.
event
c.
assignment
b.
conditional
d.
syntax
 

22. 

In Visual Basic .NET, each comment line must begin with an apostrophe or the letters ____.
a.
VBN
c.
NOTE
b.
COMM
d.
REM
 

23. 

A(n) ____ error is an error caused by code statements that violate one of the structure or syntax rules of the Visual Basic .NET language.
a.
syntax
c.
logical
b.
language
d.
structural
 

24. 

The words ____ indicate the beginning and end of a procedure.
a.
Method and Stop Method
c.
Open and Close
b.
Sub and End Sub
d.
Private and Public
 

25. 

In Text boxes, ____ are used around values to tell Visual Basic .NET to treat their numeric contents as characters, rather than as a numeric value.
a.
quotes
c.
brackets
b.
double quotes
d.
question marks
 

True/False
Indicate whether the sentence or statement is true or false.
 

26. 

Many programmers design a user interface by creating hand drawings that show the various interface elements and how they will display to a user.
 

27. 

When designing a user interface in Visual Basic .NET, first select the desired controls and then choose the inputs, processing, and outputs of data to fit those controls.
 

28. 

An input area with up and down arrows can limit a user’s input to specified values in a range.
 

29. 

If a value entered is out of an allowable range, Visual Basic .NET quits the application.
 

30. 

An output area should provide visual cues to a user to indicate that the area should not be used for input.
 

31. 

Pseudocode is Visual Basic .NET code that describes in great detail how the code for a given application should behave.
 

32. 

When you start Visual Basic .NET, you can choose to open an existing project or start a new project.
 

33. 

When you choose to start a new project in Visual Basic .NET, you can choose which type of application or Windows component that you want to create.
 

34. 

Clicking the Create directory for Solutions check box in the New Project dialog box tells Visual Basic .NET to create a subdirectory with the same name as the project, in the project location.
 

35. 

A project can contain at most one form.
 

36. 

During design time, a form becomes the window in which the application displays.
 

37. 

During design time, you set the size of a form to define the size of the application window on the desktop during run time.
 

38. 

As you start developing a user interface, you should adjust the form size to accommodate the input area, output area, and other user interface elements.
 

39. 

You cannot adjust a form’s size during design time.
 

40. 

You can drag the lower-right corner of a form to change its width and height at the same time.
 

41. 

Once you have resized a form by dragging its borders, you must then remember to update the Width and Height properties in the Properties window.
 

42. 

Clicking the Object box arrow displays a list of objects associated with the current form in the main work area, including the form itself.
 

43. 

The buttons in the Properties window are always the same, regardless of what tasks you are completing in the Visual Basic .NET IDE.
 

44. 

Clicking the Property Pages button in the Properties window opens a dialog box with options you can set for a solution or project.
 

45. 

Because the Properties list for an object can include numerous properties, the Properties window includes a scroll bar that allows you to navigate the list.
 

46. 

It is necessary to set every property for each object you add to an interface.
 

47. 

The default value for the FormBorderStyle property is FixedDialog.
 

48. 

The Visual Basic .NET Help system contains detailed information about all the form properties and property values and provides example uses for properties.
 

49. 

A Label control is used to display or allow users to enter numbers on a form.
 

50. 

In a NumericUpDown control, up and down arrows allow the user to change the value displayed in the control; the user can also type a value in the control.
 

51. 

In a NumericUpDown control, the up and down arrows increment and decrement the displayed value within a predefined range.
 

52. 

A TextBox control usually is placed on the user interface to allow a user to indicate that the application should execute an action, such as calculating a value, resetting values, or closing a window.
 

53. 

The Windows Forms tab includes buttons that represent common controls used on a Windows form.
 

54. 

You can add a control using one of two methods: drawing or dragging.
 

55. 

If you add a control by double-clicking a control button on the Windows Forms sheet, you will need to move the control from the upper-left corner of the form, and frequently, you will want to change the control’s size from the default.
 

56. 

When working with forms, you might find it is faster to add all the required controls to the form and then position them correctly on the form.
 

57. 

A control has to remain in its original location during run time.
 

58. 

You can delete a control from a form at any point during design time.
 

59. 

When an application window first displays at run time, Visual Basic .NET will set the initial focus on the control with the highest value for the TabIndex property.
 

60. 

The DecimalPlaces property of the NumericUpDown control default to 1.
 

61. 

The property values for the Value, Minimum, and Maximum properties of a NumericUpDown control can be integer or decimal values, depending on the value of the DecimalPlaces property.
 

62. 

A Label control can, for example, instruct an application to calculate or process an output, based on inputs that have been provided.
 

63. 

Each control has its own unique default name to distinguish it from another instance of the same class of objects.
 

64. 

Visual Basic .NET adds a letter to each default control name to ensure that the control name is unique.
 

65. 

Users should rename forms just like they rename controls, even though forms are not a type of control.
 

66. 

The text in a control and the name of the control are defined by the same properties and property values.
 

67. 

A control name should indicate the type of control.
 

68. 

You should be certain to name your controls while designing an interface and before writing any code.
 

69. 

An assignment statement tells the application to set the control property on the right side of the statement to the property value on the left side of the statement.
 

70. 

Companies or programming teams usually maintain their own set of coding standards that instruct programmers how code should be indented or aligned in the code window.
 

71. 

Visual Basic .NET automatically numbers all lines of code, as long as Visual Basic .NET generated the lines automatically; if you entered the lines, you need to number them manually.
 

72. 

The Options dialog box contains a list of options folders in the Options area, and many of these folders have subfolders.
 

73. 

Visual Basic .NET is not case-sensitive.
 

74. 

Visual Basic .NET will save your project automatically when you run it.
 

75. 

After finishing the development tasks on a project, the final step of the PDLC is to document the application.
 

Completion
Complete each sentence or statement.
 

76. 

As the programmer, you can determine the ____________________, or boundaries, of the allowable entries in an input area.
 

 

77. 

A(n) ____________________ is a collection of code and other files that usually encompasses one application or class.
 

 

78. 

A form’s ____________________ property defines the width of the form in pixels.
 

 

79. 

A form’s ________________________________________ property defines the height of the form in pixels.
 

 

80. 

A(n) ____________________ is a single point on a display monitor.
 

 

81. 

The ____________________ button in the Properties window displays properties grouped by category, such as Appearance or Behavior, in the Properties list.
 

 

82. 

The ____________________ button in the Properties window displays properties alphabetically in the Properties list.
 

 

83. 

When the ____________________ button is selected in the Properties window, this indicates that a list of properties currently displays in the Properties list.
 

 

84. 

The ________________________________________ button is activated when a project or solution is selected in the Solution Explorer window.
 

 

85. 

The ____________________ pane at the bottom of the Properties window displays information about the property currently selected in the Properties list.
 

 

86. 

Visual Basic .NET assigns an initial value, called the ____________________ value, for each of the properties of the objects you add to an interface.
 

 

87. 

The ____________________ property of a form specifies the position where the application window displays in the Windows desktop when the application is run.
 

 

88. 

The default value for the StartPosition property is ____________________.
 

 

89. 

Changing the StartPosition property value from WindowsDefault to the value of ____________________ sets the application window to display in the center of the user’s screen.
 

 

90. 

The ____________________ property of a form allows you to set the title that displays in the application window title bar at run time.
 

 

91. 

The ____________________ property controls the appearance of the border of a form.
 

 

92. 

Using the ____________________ property value of the FormBorderStyle property displays the application window with borders the user can drag to resize the application window at run time.
 

 

93. 

Using the ____________________ property value of the FormBorderStyle property displays the application window in one size, with the appearance of a standard Windows dialog box.
 

 

94. 

A(n) ____________________ control is used to display text information on a Windows form; the user of an application cannot change the text displayed during run time.
 

 

95. 

A(n) ____________________ control is used to display text or to allow users to enter text on a form; during run time, the contents can be changed by the user of the application.
 

 

96. 

A(n) ____________________ control is used during run time to initiate actions called events.
 

 

97. 

A(n) ____________________ control is a control that is included on the Windows Forms sheet by default and cannot be removed.
 

 

98. 

When you are adding controls to a form, the dots on the background of the form, called the ____________________ grid, serve as anchors for aligning the controls.
 

 

99. 

As you position or size a control on a form, the top, bottom, left, and right borders of the controls always align themselves, or ____________________, to the dots that display on a form.
 

 

100. 

Using the TAB key to set the focus on a control is called ____________________.
 

 

101. 

If you want Visual Basic .NET to skip a control during tabbing, you can change the value of its ____________________ property from True to False.
 

 

102. 

The ____________________ property determines whether a user can input data into a TextBox control at run time.
 

 

103. 

The ____________________ property of a NumericUpDown control defines the current value displayed in the control.
 

 

104. 

When naming forms and controls, it is beneficial to follow a standardized naming ____________________, which is an agreed-upon method for naming controls so that the control can be identified easily in code.
 

 

105. 

Most types of Visual Basic .NET controls that display on the application window recognize the ____________________ event, an event initiated when the user clicks the left mouse button.
 

 

106. 

Programmers often add comments within their code statements as a form of ____________________ documentation.
 

 

107. 

A(n) ____________________ is text added within an event procedure that explains how the code in the event procedure works or why it was written.
 

 

108. 

____________________ anticipates your needs during coding and displays prompts to assist you in coding.
 

 

109. 

The keyword, ____________________, indicates that a given event procedure is a private method for the object.
 

 

110. 

In Visual Basic .NET code, the line that starts with Private Sub is called the event ____________________ declaration.
 

 



 
Check Your Work     Reset Help
Hosted by www.Geocities.ws

1