Practice Quiz Answers
Practice Quiz Answers
Psuedocode is:
A set of programming statements calculated by the computer. Machine language A cross between human language and programming language. A code written in a specific language.
What is the default name given to the first Label control created in an application?
Label0 myLabel Label1 newLabel
Chapter 2
Chapter 2 Quiz: Creating Applications with Visual Basic
This activity contains 9 questions.
It automatically adjusts the size of the control. It is set to false by default It sizes the control based on the contents of the text property It is set to true by default
A Boolean Property:
can only hold two values changes the font size is made of many other letters and number sets the variables for the application
2. A runtime error is an attempt that the application makes while running to perform an operation that can not be executed in Visual Basic. 3. A logical error is an error in the users though process. The program will run, but does not perform the operation as anticipated and produces incorrect results. 4. The error list window shows error messages and the lines they occur.
All but 2 All the statements are true All but 4 1 and 2 only
Chapter 3
Chapter 3 Quiz: Input, Variables and Calculations
This activity contains 11 questions.
Which way does not clear a text box named txtInput for input? (hint page 99-100)
txtInput.Text.Clear() txtInput. Clear() txtInput.Text = String.Empty txtInput.Text =
i. txtBox.Focus() put the focus, and thus the cursor, into a control called txtBox. ii. Only controls capable of receiving some sort of input may have the focus. iii. When an application is running and a form is displayed, one of the forms controls always has the focus. iv. myButton.Focus() will enable the user to press the enter key to engage the button named myButtons commands.
all but iv i only all the statements are true. all but iii
i. The order the controls are placed on the form determines the tab order. ii. The tab order is permanent and can not be changed. iii. The TabIndex property contains an integer which indicates the controls position in the tab order. iv. The first control placed on a form has a TabIndex of 1.
i and iii only i and ii only all but ii all the statements are true.
i. More than one button can be assigned the same access key, but only the first button assigned the access key will be able to utilize it during a click event. ii. You assign an access key through the Text property. iii. An access key is defined by placing an ampersand (&) behind the first letter of the text the button is to contain. This will underline the first letter and make that letter an access key. iv. Access keys distinguish between uppercase and lowercase characters. Therefore, there is a difference between pressing the keys Alt and X together and Alt and x. They refer to different commands.
all but i all but iv ii only all the statements are true.
ii. To declare a variable you use a DIM statement. iii. Variable names have the same naming convention as control names. iv. A variables data type determines the amount of memory that variable uses.
all the statements are true i and ii all but ii all but iii
Which statement(s) are true? ii. Implicit type conversion is when Visual Basic attempts to convert
one value type to another value type through an assignment statement. iii. When Option Strict is set to On any conversion, other than a
widening conversion, will cause the code not to compile. iv. CStr(expr) converts a numerical, Boolean, Date or string expression to a String.
all but iii i only all the statements are true. all but iv
How many decimal places does the FormatNumber function format a number to by default?
1 2 4 3
i. The title for the Group Box is stored in the Group Boxs Text property. ii. To place a control inside a Group Box, select the existing Group Box control, and then double click the desired tool within the toolbox to place the control within the Group Box. iii. To place a control inside a Group Box, select the existing Group Box control, and then double click on the desired tool within the toolbox to place the control within the Group Box. iv. Group Box controls can receive the focus, and have an access key assigned to them.
i only
all but iii all the statements are true. all but iv
Chapter 4
Chapter 4 Quiz: Making Decisions And Working With Strings
This activity contains 10 questions.
called a
relational operator flag constant value arithmetic operator
Which of the following until one is found to be true, executes the statements under statements are true about the true condition, and then leaves the structure. IfThenElseIf statements:
ii. IfThenElseIf statements are like a chain of If statements. iii. IfThen ElseIf statements evaluate all statements in the structure once a true condition is found, and do not leave the structure until a break statement is encountered. iv. An Else statement placed at the end of an IfThenElseIf statement ensures that a default action is always executed if none of the proceeding statement conditions in the IfThenElseIf structure were met.
all but iii all but i only i and ii i only
This operator reverses the truth value of an expression; making a true expression false and a false expression true.
Xor And Or Not
Which string property or function returns the length of a string variable stored in strVar?
9. Which is the conversion for the following If...Then...ElseIf statement to a Select...Case statement?
If intValue > 0 And intValue <= 9 Then discount = .10 Else If intValue >9 And intValue <=20 discount = .15 Else discount = .20
Select Case intValue Case Is 1 To 9 discount = .10 Case Is 10 To 19 discount = .15 Case Else discount = .20 End Select Select Case intValue Case 1 To 9 discount = .10 Case 10 To 19 discount = .15 Case Else discount = .20 End Select Select Case intValue Case 1 To 9 discount = .10 Case 10 To 20 discount = .15
Case Else discount = .20 End Select Select intValue Case intValue 1 To 9 discount = .10 Case intValue 10 To 20 discount = .15 Case Else discount = .20 End Select Select Case intValue Case intValue 1 To 9 discount = .10 Case intValue 10 To 19 discount = .15 Case Else discount = .20 End Select
Which are characteristics of a CheckBox control? ii. you can use code to select or deselect a check box by
using an assignment statement and the Checked property. iii. a CheckChanged event is triggered whenever the user changes the state of a check box. iv. a check boxs Checked property can only be set with an assignment statement during run time.
only i and iv
Chapter 5
Chapter 5 Quiz: Lists, Loops, Validation, and More
This activity contains 13 questions.
A _________ control is used to gather input without placing a text box on a form.
Variable Input Box Check Box List Box Message Box
A _________ control displays a list of items and allows the user to select one or more items from the list.
Input Box List Box Message Box Check Box
The ___________ property determines the number of items stored in a list box.
.Count.Items .Items.Count .Items.Index .Items.Number
To add values to a List Box during run time use the following method:
ListBox. Item.Add(Item) ListBox. Items.Add(Item) ListBox. Items.Add.Item ListBox.Items.Insert(Item) ListBox:Items.Add(Items)
A ____________ loop uses a counter variable to perform the loop a specific number of times.
For Next If Then Do While Do Until
i. Both display a list of items to the user. ii. Both have Items.Add, Items.Clear, Items.Remove and Items.RemoveAt methods. iii. Both have Items, Itmes.Count, Sorted, and SelectedItems properties
iv. Both have a rectangular area that functions like a text box.
only ii and iii all are true all but iv all but i
i. It is a small box that is displayed when the user holds the mouse cursor over a control. ii. The ToolTip control is invisible at runtime. iii. The ToolTip control appears in the component tray at run time. iv. The InitialDelay property measures the amount of time in milliseconds that a ToolTip remains on the screen once it is displayed by the user.
i, ii and iii only i and ii only i and iv only All are true i and iii only
______________ is the process of inspecting information given to the application by a user, and making sure that it is valid.
User Validation Input Validation Inspection Validation Syntax Validation
Chapter 6
Chapter 6 Quiz: Procedures and Functions
This activity contains 10 questions.
If you leave out the AccessSpecifier part of the Procedure declaration, it defaults to:
Public Protected Private Global
A special variable that receives a value being passed to a procedure is called a _____________.
Argument Procedure Variable Parameter Specifier
A static variable retains its stored value for the lifetime of the application Only variables declared within procedures may be static. The static variable scope is only the procedure in which they were declared. In order to declare a static variable, replace Dim with Static Static variables are destroyed when the procedure terminates.
To pass a parameter by reference, use the _________ keyword to in the declaration of the parameters variables.
ByRef ReDim Dim
ByVal
A _____________ returns a value to the part of the program that called it.
Declaration Variable Function Call Procedure
In debugging a program you would use the ___________ command to go through a function or procedure one line at a time.
Step Out Step Over Step Into Debug
Chapter 7
Chapter 7 Quiz: Multiple Forms, Standard Modules, and Menus
This activity contains 10 questions.
Which statements about Form Name Properties and Form Files are true?
i. You assign a name to a form in its Name property, using the standard prefix of frm. ii. A form should be assigned a name that describes the forms purpose.. iii. The code associated with a form created in Visual Basic is stored in a Form File with a .vb extension added to the forms Name property. iv. If you change a forms file name, the Name property changes automatically to match the files name .
all but iii all but iv all are true ii and iii only
At design time you can switch between forms by double clicking the forms entry in the ________________ window.
Solution Explorer Project Design Code
i. You show the form using either the ShowDialog method or the Show method. ii. When a modal form is displayed, no other form can be displayed until the form is closed or hidden. iii. When a modal form is displayed, no other statements in the procedure will execute until the form is closed or hidden. iv. The general format to close a modal form is me.close(). .
all but ii i and iii only all but i all are true
A procedure or variable declarations used in more than one file should be stored in a ___________ Module.
Standard Form Private Public
form automatically after all its statements are executed. iii. Main can be written as a function instead of a procedure returning an integer value to indicate the success or failure of the codes execution.. iv. You can designate either a form or a private procedure called Main as an applications startup object.
Using the ___________ keyword makes a class level variable available to methods outside of the class.
Private Standard Public Dim
Which one of the following is not a standard menu item that should always be added to your menu systems?
File
Help An Exit command on the Help menu. An About command on the Help menu. An Exit command on the File menu
Chapter 8
Chapter 8 Quiz: Arrays, Timers, and More
This activity contains 13 questions.
i. An array stores multiple values of the same type using one name. ii. Values stored within an array are called elements. iii. An index is a number used to identify a specific element within the array. iv. If n is the number of elements within an array, the index of the first element in the array would be 0 and the index of the last element in the array would be n-1.
all but iv are true only ii and iii are true all but ii are true all are true
subscript to an array, allows you to utilize a ____________ to access each element of the array.
loop command class sub procedure or function
A special loop designed specifically to read values from arrays, but not to modify the values, is called:
a DoUntil loop a DoEach loop a DoWhile loop a ForNext loop a ForEach loop
If an array is declared with the following syntax: Dim studentID(10) As Integer the number statement studentID.Length will return a value of:
11 10 0 The maximum number of characters each element in the array contains.
What would the following snippet of code using an array named intValue of 50 integer values accomplish? Dim temp As Integer Dim i As Integer Dim j As Integer
For i = 0 to (intValue.Length - 2) For j = (i + 1) to (intValue.Length - 1) If intValue(i) < intValue(j) Then temp = intValue(i) intValue(i) = intValue(j) intValue(j) = temp End If Next j
Next i
It would sort the array from lowest to highest, so that intValue(0) would contain the smallest value in the array, and intValue(49) would contain the largest value in the array. It would make all the array values in intValue alike. It would sort the array from highest to lowest, so that intValue(0) would contain the largest value in the array, and intValue(49) would contain the smallest value in the array. It would make IntValue(0) the smallest value in the array
i. The word Preserve is optional, and when used with a ReDim statement makes sure that any existing values within the array are not destroyed. ii. A ReDim statement redefines the dimension of an existing array iii. A ReDim statement is used when the number of elements an array will contain is known at design time. iv. The statement: Dim intValue() as Integer is incorrect syntax because the array size is missing.
only ii and iii are true all are true all but iii and iv are true only ii is true
To pass an array to a procedure or function, the parameter variable is declared as an array with
the upper subscript defined the upper subscript as a variable to be defined by the user within the sub procedure or function An array can not be passed to a procedure or a function.
In the multidimensional array declaration: Dim intValues(4, 15) as Integer the number 15 stands for:
The last dimension, where the array intValue starts at subscript 4 and ends at subscript 15. The highest column subscript The highest row subscript The number of total values that can be stored in the array
In the multidimensional array declaration: Dim newValues(2, 5, 15) as Decimal the array dimension is:
15 5 3 2 Can not be determined
i. A Timer Control is used to automatically execute code at regular intervals during the run of an application. ii. A Timer Control responds to a Tick Event. To generate a Tick Event procedure, double click a Timer Control that has been placed within a form. iii. A Timer Control has three important properties; Enable, Visible, and Interval. iv. The Interval property works in milliseconds; therefore if the property is set to 100, the interval will restart every second.
all but iii and iv are true only ii and iii are true all but iii all are true
When a control is ___________, it is positioned directly against one of the edges of a form.
created anchored docked sized
Which statements nano-second. about the random class are true? ii. The random seed value provides the initial input that generates
i. The random seed value is based on the time of day down to the
the next random number in the series. iii. The statement: Private rand As New Random(12) creates an instance of the Random class with a variable name rand, and with a seed of 12. iv. The statements: Private rand As New Random Dim intNum As Integer = rand,next(100) assigns to intNum a randomly generated integer value somewhere between 0 and 99.
all are true only ii and iii are true all but i is true only ii is true
Chapter 12
__________________ programming is a way of designing and coding applications such that interchangeable software components can be used to build larger programs.
COBOL Visual Basic C++ Object-oriented
The portion of the class that is visible to the application programmer is the :
class interface class implementation operations attributes
___________ describe the properties that all objects in the same class have in common.
operations class implementation attributes class interface
method
A _________ is a method named New that is automatically called each time an instance of a class is created.
finalizer function constructor operator
i. A collection is similar to an array in that they are both single units that contain multiple items in which individual items are designated by an index. ii. The index subscript begins at 0 for both a collection and an array. iii. In a collection, the individual items do not have to be the same
datatype. iv. Collections automatically expand or contract as items are added or removed from the collection.
all but iii and iv are true all are true only ii and iv are true all but ii are true
_____________ allows you to create new classes that derive characteristics from existing classes.
Derivatives Constructors Members Inheritance
Chapter 11
Chapter 11 Quiz: Developing Web Applications
This activity contains 10 questions.
Which of these statements are true and pages on the internet. about URLs?
ii. A domain name is part of a URL. iii. A protocol is always at the end of a URL. iv. A URL can contain file and folder paths.
all are true only ii and iii are true all but iii are true all but iii and iv are true
Which of these statements are content, program logic, and configuration information. true about ASP.NET?
ii. ASP.NET is called a platform. iii. ASP.NET uses a compiler to check for programming errors. iv. A web application written in ASP.NET use special pages called web forms.
all but iii are true only ii and iii are true all are true all but iii and iv are true
____________controls are used to display database and XML data in grids and lists.
Navigation Data Validation HTML
i. File System web site. ii. FTP web site. iii. HTTP web site. iv. Standard web site.
all are true all but iii are true only ii and iii are true all but iv are true
i. Web controls have a new property named AutoPostBack. ii. The Enable property is only used on Windows controls. iii. The ID property of the Web control is the counterpart of the Name property of the Window control. iv. Web controls lose their runtime properties when the user moves away from the current page.
all are true only ii and iii are true all but ii are true all but iii and iv are true
Which statements are true about control causes the form to be posted back to the the AutoPostBack property? server.
ii. The ImageButton control automatically posts the current page back to the server . iii. All controls have an AutoPostBack property. iv. AutoPostBack defaults to false for all controls.
all are true all but iii and iv are true all but iii are true only ii and iii are true
The property used to determine whether a user can select one or multiple items from a ListBox control is:
SelectedIndex SelectionMode SelectionValue SelectedItem
Which of the following statements are true about HTML Table controls?
i. To insert a table into a forms design select Insert Table from the Table menu. ii. The tables Border property set to 1 by default. iii. The row and column height adjustments are given in inches. iv. Static text typed into a tables cell is left justified by default.
all are true only ii and iii are true all but ii and iii are true
Which are methods used to move from one web page (the source page) to another web page (the target page)?
i. Place the URL of the target page in the NavigationURL property of a Hyperlink control. ii. Write code in the click event handler of a Button, ImageButton, or LinkButton control. iii. Select a block of text with the mouse, click the Hyperlink button on the formatting toolbar, and enter the URL of the target web page. iv. Use a Response.Redirect statement in the click event handler of a Button, ImageButton, or LinkButton control.
only ii and iii are true all but iii all are true all but iii and iv are true
Web forms applications use a _________________ control to access databases from Windows Forms.
SQL Dataset Datasource Access
Chapter 9
Chapter 9 Quiz: Files, Printing, and Structures
This activity contains 10 questions.
In a ______________ file, the data in the file must read from its beginning until its end.
text
It writes a line of data to a file, then writes a space character immediately after the data. It writes a line of data to a file. It writes a line of data to a file, then writes a tab character immediately after the data. It writes a line of data to a file, then writes a newline character immediately after the data.
What is the difference between the WriteLine method and the Write method of the StreamWriter class?
The Write method writes a line of data to a file and writes a new line character at the end of the line; while the WriteLine method writes only the line of data,. There is no difference. The WriteLine method only writes text, while the Write method writes any data type. The WriteLine method writes a line of data to a file and writes a new line character at the end of the line; while the Write method writes only
The ________ method writes any unsaved information remaining in the file buffer and releases memory allocated by the StreamWriter object.
To determine a file exists, you should use the following method syntax:
PrintDocument
To print a 3 column output of 10 spaces in each column, you would use the method:
A ______________ is a data type that is user created, containing one or more variables known as fields.