Computer Programming I: Input Box, Character Variable, Loop – Flashcards
234 test answers
Unlock all answers in this set
Unlock answers 234question
Digits in binary are also know as bits
answer
True
Unlock the answer
question
________ is another name for Decimal.
answer
Base 10
Unlock the answer
question
101 in base 2 equals ______ in decimal.
answer
5
Unlock the answer
question
What base number system is also known as hexadecimal?
answer
16
Unlock the answer
question
The F in hexadecimal is equal to
answer
15
Unlock the answer
question
The binary number 1000110 equals ________ in hexadecimal.
answer
46
Unlock the answer
question
The hexadecimal number A41 is ________ in binary
answer
101001000001
Unlock the answer
question
If a zero is shown in binary, it represents
answer
off
Unlock the answer
question
The act of sending an e-mail that falsely claims to be a legitimate business in an attempt to obtain the user's personal information is called
answer
phishing
Unlock the answer
question
What is the purpose of the Fair Credit Reporting Act of 1970?
answer
To give individuals the right to see information collected about them for use by credit, insurance and employment agencies.
Unlock the answer
question
What law protects against copyright infringement?
answer
The NET Act of 1977
Unlock the answer
question
This act restricts the way in which personal data can be used by federal agencies.
answer
The privacy act of 1974
Unlock the answer
question
"This Code, consisting of 24 imperatives formulated as statements of personal responsibility, identifies the elements of such a commitment."
answer
ACM Code of Ethics and Professional Conduct
Unlock the answer
question
Marketing technique where data is collected about customers visiting a website
answer
Online profiling
Unlock the answer
question
Text file created by the server computer when a user enters information into a website.
answer
Cookie
Unlock the answer
question
Tiny, transparent graphics located on web pages or in e-mail message that are used in combination with cookies to collect data about web page users or email senders
answer
Web Bacons
Unlock the answer
question
Requires federal agencies to develop, document and implement an agency-wide program to provide information security
answer
Federal Information Security Management Act of 2002
Unlock the answer
question
Requires commercial websites that collect personal information from children under the age of 13 to obtain parental consent.
answer
Children's Online Privacy Protection Act of 1988
Unlock the answer
question
Gives law enforcement the ability to monitor individual's email and web activity
answer
Provide Appropriate Tools Required to Intercept and Obstruct Terrorism (PATRIOT) Act of 2001
Unlock the answer
question
Which of the following would not be in an Acceptable Use Policy?
answer
You may access, upload, download, or distribute materials.
Unlock the answer
question
Which of the following does not deal with ergonomics?
answer
power and paper waste
Unlock the answer
question
Which of the following does deals with computers in the workplace?
answer
employee monitoring
Unlock the answer
question
A program that is able to reproduce itself over a network
answer
worm
Unlock the answer
question
What are the five steps of the programming process?
answer
- Identify the Problem
- Design the Solution
- Write the Program
- Test the Program
- Document and Maintain the Program
Unlock the answer
question
What are English-language statements that describe the processing steps of a program in paragraph form?
answer
pseudocode
Unlock the answer
question
What are the part/s of identifying the problem?
answer
Requirement and Specifications
Unlock the answer
question
What is most frequently used design in the programming process?
answer
Top-Down Design
Unlock the answer
question
___________________ is breaking down a problem into smaller sub-problems.
answer
Modularization
Unlock the answer
question
What is an algorithm?
answer
A set of steps that create an ordered approach to a problem solution
Unlock the answer
question
The proper use of syntax in a programming language is called ____________.
answer
programming style
Unlock the answer
question
All of the following are part of testing except
answer
deployment
Unlock the answer
question
hich of the following is the proper way to write a single line comment in Visual Basic?
answer
'Visual Basic
Unlock the answer
question
All of the following are reasons for commenting in your code except
answer
You are creating user documentation.
Unlock the answer
question
Which of the following is an example of pseudocode?
answer
If button is clicked then add the numbers else  
Unlock the answer
question
Which of the following is an algorithm?
answer
- Click the button
- Add the numbers
- Show the answer
Unlock the answer
question
In a Flowchart, what indicates the flow of logic?
answer
direction of the arrow
Unlock the answer
question
Testing for all syntax errors is called:
answer
debugging
Unlock the answer
question
The following is an example of what?
Turn left on Ocean Drive,
- Proceed down Main Street for two miles
Take a right turn at the fork onto Eagle Street? ELSE At the fork, take Swan Street to the left. Proceed two blocks. House is second on the left. (246 Swan Street.) ENDIF
- Proceed on Ocean Drive for three blocks, to the fork.
- IF left turn at fork is blocked THEN
answer
IFTHENELSE Control Structure
Unlock the answer
question
The following is an example of what?
Wash hair. Rinse. Repeat.
question
Which window displays the application interface and allows objects to be added, deleted, and sized?
answer
the design window
Unlock the answer
question
Which area of the IDE contains controls that are used to create objects on the interface?
answer
the toolbox
Unlock the answer
question
Which area of the IDE is used to switch between the Design and Code windows?
answer
the solution explorer window
Unlock the answer
question
Which area of the IDE is used to change the text displayed in a Label object?
answer
the properties window
Unlock the answer
question
To size an object:
answer
select it and then drag a handle
Unlock the answer
question
Which is not a property of the Label control?
answer
style
Unlock the answer
question
Which object is used to group related radio buttons?
answer
a groupbox object
Unlock the answer
question
Which control object should be used when the user must select only one option from a set of options?
answer
radiobutton
Unlock the answer
question
What are the ways you can create a new project in Visual Basic?
I. Click on the New Project button on the toolbar II. Click on the Create link on the Start Page in he Recent Projects area. III. Click on the File menu, then click on New Project
answer
I, II, and III
Unlock the answer
question
What contains the controls that are used to create objects on the interface?
answer
The toolbox
Unlock the answer
question
________________ define the appearance, behavior, position and more of a control.
answer
properties
Unlock the answer
question
A graphical object that contains a title bar, a system menu and minimize, maximize and close buttons.
answer
form
Unlock the answer
question
This property sizes the label to fit the text
answer
autosize
Unlock the answer
question
Which segment of code correctly sets the Text property of the Label to "Programming rocks!"
answer
lblMessage.Text = "Programming rocks!"
Unlock the answer
question
Which segment of code correctly puts the message "Programming Rocks!" on two lines?
answer
lblMessage.Text = "Programming" & vbCrlf & "Rocks!"
Unlock the answer
question
What is the result of adding the GroupBox control to the form after placing RadioButtons on the form?
answer
You can select more than one RadioButton
Unlock the answer
question
Select the prefix that goes with the control.
answer
=RadioButton -> rad =GroupBox -> grp =CheckBox -> chk =Button -> btn =Label -> lbl
Unlock the answer
question
Which property will evaluate to whether or not a radio button has been selected?
answer
radProgram.checked
Unlock the answer
question
Which of the following statements is false given the image?
answer
The Autosize property is set to false
Unlock the answer
question
Given the following code, which RadioButton has been selected?
radChocolate.Checked = true radStrawberry.Checked = false radVanilla.Checked = false
answer
radChocolate
Unlock the answer
question
A variable is a named memory location that stores a value.
answer
true
Unlock the answer
question
Multiple variables with the same data type can be declared in a single statement.
answer
true
Unlock the answer
question
A variable can store more than one value at any given time.
answer
false
Unlock the answer
question
A local declaration allows a variable to be used anywhere in the module or form
answer
false
Unlock the answer
question
Which object allows users to enter values?
answer
a textbox object
Unlock the answer
question
A label placed near a text box that describes its contents or purpose is called a
answer
prompt
Unlock the answer
question
The TextBox control Name property
answer
identifies a control for the programmer
Unlock the answer
question
The TextBox control Text property
answer
determines what text is displayed in the text box
Unlock the answer
question
A named memory location which stores a value that cannot be changed from its initial assignment is called a
answer
constant
Unlock the answer
question
Which data type should be used to represent values with a decimal portion?
answer
double
Unlock the answer
question
Which data type should be used to represent single characters?
answer
char
Unlock the answer
question
Match the prefix with the data type.
answer
=double -> dbl =long -> lng =boolean -> bln =character -> chr =short -> srt =string -> str =integer -> int =single -> sng =decimal -> dec
Unlock the answer
question
Which data type would the variable representing the following values need to be?
answer
=Character -> letter grade =Integer -> number of workers in a small company =Decimal -> the amount of a pay check =String -> company name
Unlock the answer
question
Which statement correctly assigns the value 5 to the variable intNum?
answer
intNum = 5
Unlock the answer
question
Which statements correctly declare a variable and initialize it (give it a starting value)? There are more than one.
answer
...
Unlock the answer
question
Which statement correctly uses the ToString method?
answer
lblTotal.Text = decTotal.ToString("$###.##")
Unlock the answer
question
Which statement correctly uses the format function?
answer
Me.lblAnswer.Text = Format(intNum, "Standard")
Unlock the answer
question
Which statement correctly displays a messagebox with the message "Programming is awesome!"?
answer
MessageBox.Show("Programming is awesome!")
Unlock the answer
question
When you want a variable, like a counter, to hold its value, it should be declared as ___.
answer
static
Unlock the answer
question
Writing your code to allow for unexpected input from the user is called ____________.
answer
program debugging
Unlock the answer
question
A ________ is a tool used by the programmer to isolate a section of code and watch how the compiler steps through it.
answer
breakpoint
Unlock the answer
question
The _____________ allows the coder to track the value of variables as the program is being executed.
answer
watch window
Unlock the answer
question
Which code segment correctly uses a Try...Catch?
answer
Try intAge = Convert.ToInt32(txtAge.Text) MessageBox.Show("Your age is: " & intAge) Catch ex as exception MessageBox.Show("Enter your age in digits!"); End Try
Unlock the answer
question
Which code segment correctly uses the function IsNumeric?
answer
If IsNumeric(strNumEnt) Then intNum = Convert.ToInt32(strNumEnt) Else MessageBox.Show("Incorrect Input. Enter a number please") End If
Unlock the answer
question
Which program segment correctly demonstrates program debugging?
answer
Try dblInput = Convert.ToDouble(txtInput.Text) Catch MessageBox.Show("Enter numeric input.") End Try
Unlock the answer
question
Which of the following tools can NOT be used for programmer debugging?
answer
Try...Catch
Unlock the answer
question
How do you access the Locals watch window if it is closed?
answer
debug menu
Unlock the answer
question
This debugging control tells the compiler to move to the next line of code in the programming block
answer
step into
Unlock the answer
question
Which of the following lines of code are optional?
Try statements Catch Ex As Exception statements Finally statements End Try
answer
Finally
Unlock the answer
question
Given the following statements:
If intGuess = intSecretNum Then Me.lblMessage.Text="You guessed it!" Else Me.lblMessage.Text="Try again" End IfWhat is displayed when intGuess is 35 and intSecretNum is 48?
answer
try again
Unlock the answer
question
Which statement should be used to decide among three or more actions?
answer
If...Then...ElseIf statement
Unlock the answer
question
Given the folowing statements:
Select Case intNum Case Is<10 Me.lblMessage.Text="Num is less than 10." Case Is<20 Me.lblMessage.Text="Num is less than 20" Case Is>=20 Me.lblMessage.Text="Num is greater than 20." End SelectWhat message would be displayed if intQuantity is 16?
answer
Num is less than 20
Unlock the answer
question
Given the following statements, what is displayed in the label?
Dim gen As New Random() Dim intNum As Integer intNum = gen.Next(50, 100) lblAnswer.Text = intNum.ToString()
answer
an integer greater than or equal to 50 and less than 100
Unlock the answer
question
Which statement generates random numbers in the range from 1 to 50?
answer
Next(1, 50)
Unlock the answer
question
Which is not a logical operator
answer
if
Unlock the answer
question
Which statement displays the following message box?
answer
MessageBox.Show("Try again")
Unlock the answer
question
Given the following statements:
Dim intNum As Integer = 10 If intNum > 5 Then Me.lblMessage.Text = "Great Job" Else Me.lblMessage.Text = "Try Again" End IfWhat is displayed when the statements execute?
answer
great job
Unlock the answer
question
Which for the following statements will short circuit correctly?
answer
If dblGPA >= 3.5 AndAlso intSAT >=1200
Unlock the answer
question
What is the process when the computer looks a the first Boolean expression in a compound Boolean expression to determine if it needs to look at the remainder of the statement?
answer
short circuit
Unlock the answer
question
What shows the possible outcomes of a compound Boolean expressions?
answer
truth table
Unlock the answer
question
What is the order of evaluation with logical operators?
answer
Not, And, Or
Unlock the answer
question
Which of the following Case statements is written incorrectly?
answer
Case < 10
Unlock the answer
question
Which of the following Case statements is written correctly?
answer
Case 1 to 10
Unlock the answer
question
What is the error in the following code?
If intNum1 > 10 Then If intNum1 < 50 Then lblResult.Text = "Between 10 and 50" End If
answer
You need another End If statement
Unlock the answer
question
Which statement/s are properly written to increment a counter variable by 1?
answer
counter=counter+1 counter+=1
Unlock the answer
question
Given the following statements, how many times will the body of the Do...Loop execute?
Dim intNum As Integer = 0 Do intNum = intNum + 1 Loop While intNum < 5
answer
5
Unlock the answer
question
Which function is used to convert an entry from an input box to an Integer?
answer
Convert.ToInt32()
Unlock the answer
question
Which statement correctly updates the accumulator intSum (syntax)?
answer
intSum = intSum + intNum
Unlock the answer
question
Given the following statements, how many message boxes will be displayed?
Dim intNum As Integer For intNum = 1 To 10 MessageBox.Show(intNum.ToString()) Next intNum
answer
10
Unlock the answer
question
Given the following statements, what is the value of intNum after the last loop iteration?
Dim intNum As Integer For intNum = 1 To 5 MessageBox.Show(intNum.ToString()) Next intNum
answer
6
Unlock the answer
question
Which of the following statements about an accumulator is false?
answer
An accumulator is a value that is incremented by the same value.
Unlock the answer
question
What is an iteration?
answer
The execution of the loop one time
Unlock the answer
question
Which loop is a posttest loop?
answer
Do ...Loop While
Unlock the answer
question
Given the following statements, how many times will the body of the Do...Loop execute?
Dim intNum As Integer = 0 Do While intNum < 20 intNum = intNum - 2 Loop
answer
infinitive
Unlock the answer
question
Which code segment correctly checks to see if input was entered before looping?
answer
Do While (strEntered <> Nothing) Loop
Unlock the answer
question
Which code segment would correctly check that input was entered between 1 and 10, inclusive?
answer
Do strNumInput = InputBox("Enter a number between 1 and 10 inclusive") intEntered = Convert.ToInt16(strNumInput ) Loop While (intEntered < 1 Or intEntered > 10)
Unlock the answer
question
Which of the following code segments would NOT count backwards from 5 to 1?
answer
For intNum As Integer = 0 To 5 Step 1 Next intNum
Unlock the answer
question
What is the result of the following code?
Dim x As Integer = 100 Do While (x <= 100) x -= 1 Loop
answer
an infinite loop
Unlock the answer
question
What is a condition used to signify that a loop should stop executing?
answer
sentinental
Unlock the answer
question
Which statement will correctly get input from a user using an InputBox?
answer
strInput = InputBox("Enter something", "Input Example")
Unlock the answer
question
When should you use an accumulator?
answer
When you want to add a changing amount to the variable.
Unlock the answer
question
Which loop structure will always loop at least once?
answer
Do...Loop While
Unlock the answer
question
Which loop will count all even numbers between 1 and 10?
answer
For i As Integer = 0 To 10 Step 2 sum = sum + 1 Next i
Unlock the answer
question
Which code segment would close an application using a menu?
answer
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click Application.Exit() End Sub
Unlock the answer
question
What is the procedure to add a menu to a form?
answer
Select the MenuStrip control from the ToolBox and click the form to add it.
Unlock the answer
question
Which control displays a list from which the user can select one or more items?
answer
listbox
Unlock the answer
question
Which code segment would return true if the user selected "Puppy"?
answer
if lstAnimals.SelectedItem = "Puppy" Then . . .
Unlock the answer
question
Which of the following statements will check to see if "Yellow" has been selected from the ListBox?
answer
if lstColors.SelectedIndex = 1 Then . . .
Unlock the answer
question
Which control would allow a user to select from a list as well as enter input?
answer
combobox
Unlock the answer
question
Which statement will check to see if the user entered a value into the ComboBox?
answer
If cboColor.SelectedIndex >= 0 Then Color = cboColor.SelectedItem Else Color = cboColor.Text End If
Unlock the answer
question
Which statement would hide the ComboBox?
answer
cboZoo.Visible = false
Unlock the answer
question
Which statement would sort the ListBox?
answer
lstColors.Sorted = true
Unlock the answer
question
Which statement will clear all items from the ListBox?
answer
lstChoices.Items.Clear()
Unlock the answer
question
What happens to a ListBox if the list entered is longer than the ListBox?
answer
A scrollbar is automatically added.
Unlock the answer
question
What happens given the following items in the ListBox and the following if statement?
lstZoo Contents: bear lion tiger if lstZoo.SelectedItem = "Bear" Then ...
answer
The items do not match. The boolean expression is false and the following code will not execute.
Unlock the answer
question
Which of the following event procedures should you use to clear an answer if the user selects another choice in a ListBox?
answer
lstChoices.SelectedIndexChanged
Unlock the answer
question
Which of the following statements will check to see if an item was selected in the ComboBox cboColors?
answer
If cboColors.SelectedIndex >= 0 Then ...
Unlock the answer
question
Which of the following statements is true regarding TryParse?
answer
TryParse (String, Int32) converts the string into the destination argument and returns true/false indicating success/failure.
Unlock the answer
question
Given the following code, what is the value of result?
Dim strNum As String = "10" Dim intNum As Integer Dim result As Boolean result = Int32.TryParse(strNum, intNum)
answer
true
Unlock the answer
question
Given the following code, what is the value of result?
Dim strNum As String = "ten" Dim intNum As Integer Dim result As Boolean result = Int32.TryParse(strNum, intNum)
answer
false
Unlock the answer
question
Given the following code, what is the value of intNum?
Dim strNum As String = "10" Dim intNum As Integer Dim result As Boolean result = Int32.TryParse(strNum, intNum) lblResult.Text = intNum
answer
10
Unlock the answer
question
Given the following statements:
Dim intX As Integer For intX = 1 To 12 MessageBox.Show(intX) Next intXHow many message boxes will be displayed?
answer
12
Unlock the answer
question
Which statement displays the following message box?
answer
MessageBox.Show("Try again")
Unlock the answer
question
Which of the following code segments will check to see if the user selected the Yes button on the MessageBox?
answer
If (MessageBox.Show("Would you like to continue?", "Continue?", MessageBoxButtons.YesNoCancel) = DialogResult.Yes Then . . .
Unlock the answer
question
Which code segment will correctly display an InputBox and get the value for an Integer variable?
answer
intNum = Convert.ToInt32(InputBox ("Enter a number between 1 & 10", "Numbers"))
Unlock the answer
question
Which statement correctly displays a user-defined DialogBox?
answer
AboutForm.Show()
Unlock the answer
question
What is the data type of the value returned from an InputBox?
answer
string
Unlock the answer
question
An event procedure is a Sub procedure written for a specific object event.
answer
true
Unlock the answer
question
A variable or value passed to a sub is called a formal parameter.
answer
false
Unlock the answer
question
Arguments passed by value MUST be constants.
answer
false
Unlock the answer
question
Postconditions should be included with every sub
answer
true
Unlock the answer
question
If you need to alter the value of the actual variable used in the sub call, you should use a reference variable.
answer
true
Unlock the answer
question
The location in memory where its value is stored is its address.
answer
true
Unlock the answer
question
The event procedure's name affects the procedure execution.
answer
false
Unlock the answer
question
How many arguments are passed in the statement:
calculate (intNumerator, intDenominator, dblAnswer)
answer
3
Unlock the answer
question
The arguments in call statement must
answer
correspond in order to the parameters in the procedure being called
Unlock the answer
question
Function procedures
answer
perform a specific task and then return a value
Unlock the answer
question
Given the following function, what is returned if intNum is 12?
Function IsValid(ByVal intNum As Integer) As Boolean If intNum ; 0 And intNum ; 11 Then Return True Else Return False End If End Function
answer
false
Unlock the answer
question
What statement/s must be true when a sub completes execution?
answer
postcondition
Unlock the answer
question
Which statement can be used to execute a sub procedure?
answer
call
Unlock the answer
question
The breaking up of a program is called ______________
answer
modularization
Unlock the answer
question
All of the following are advantages of dividing a program into parts except
answer
more code redundancy
Unlock the answer
question
=Private Sub getName (ByVal strFName As String, ByVal strLName As String)
answer
Private Sub getName (ByVal strFName As String, ByVal strLName As String)
Unlock the answer
question
Which sub header is written correctly?
answer
Private Sub getNums (ByVal intFirstNum As Integer, ByVal intSecNum As Integer)
Unlock the answer
question
Given the following sub header, which call would correctly access the sub?
Private Sub getPerimeter (ByVal dblSide1 As Double, ByVal dblSide2 As Integer)
answer
=getPerimeter (dblNum, intNum)
Unlock the answer
question
Which of the following headers is written correctly?
answer
Function isInteger (ByVal intNum As Integer) As Integer
Unlock the answer
question
Which of the following code segments will correctly call the function getArea if it has two parameters?
answer
intAnswer = getArea (intNum1, intNum2)
Unlock the answer
question
Match each word with it's definition or example.
answer
=Modularization -> The breaking up of a program =Sub Procedure -> A block of code that will execute in response to a "call" from inside another block of code. =Public -> Allows access from any module within the project =Private -> Allows access only from within the same module =Value Parameter -> A parameter that passes the value to the sub procedure. =Reference Parameter -> A parameter that passes a reference to the variable to the sub procedure. =Precondition -> Assumptions or initial requirements of a procedure =Postcondition -> A statement of what must be true at the end of the execution of a procedure if the procedure has worked properly. =Strong Typing -> Assigning a data type to ALL variables including those in procedure calls =Function -> Function addNums (ByVal intNum As Integer, ByVal intNum2 As Integer) As Integer
Unlock the answer
question
What is Values.Length given the statement
Dim Values() As Integer = {5, 8, 3, 9, 2}
answer
5
Unlock the answer
question
What will occur when an invalid array index is used in a statement?
answer
a run time error will occur
Unlock the answer
question
The length of the array class returns
answer
the number of elements in an array
Unlock the answer
question
Given the following statements:
Dim strFirstName(5) As String strFirstName(6)="John"The strFirstName(6)="John" statement
answer
causes a run time error
Unlock the answer
question
A linear search
answer
searches an array one element at a time until a specific value is found or the entire array has been searched
Unlock the answer
question
Which statement changes the size of an existing array at run time?
answer
he ReDim Statement
Unlock the answer
question
The ReDim Preserve Statement is used to___.
answer
Keep the existing values in an array when sizing it
Unlock the answer
question
Which Call statement properly passes an array?
answer
Call SumValues(intArray)
Unlock the answer
question
Dim Inventory() as Integer = {357, 126, 220} Call Stock(Inventory(2),Me.lblOutput) Sub Stock (ByVal Number As Integer, ByRef lblLabel As Label) Me.lblLabel.Text = Number End SubWhich is displayed in the label when the code is executed?
answer
220
Unlock the answer
question
Which statement is false?
answer
The elements in an array are initialized to 1 if they are of type Integer
Unlock the answer
question
Which is an example of an index?
answer
3
Unlock the answer
question
How many array elements are declared in the statement: Dim students() as String = {"Leslie", "Chris", "Julie"}?
answer
3
Unlock the answer
question
Which are the index values associated with the array declaration below? Dim students() as String = {"Leslie", "Chris", "Julie"}
answer
0,1,2
Unlock the answer
question
Which of the following statements correctly declares and initializes an array?
answer
Dim strArray() As String = {"Tim", "Joe", "Alan", "Tom"}
Unlock the answer
question
Which of the following For Each statements is written correctly?
answer
For Each name As String In NameArr
Unlock the answer
question
Given the following code, what is the output?
Dim strPets() As String = {"Dog", "Cat", "Ferret", "Fish"} Array.Reverse(strPets) For i as Integer = 0 to strPets.Length -1 lstDisplay.Items.Add(strPets(i)) Next i
answer
Fish Ferret Dog Cat
Unlock the answer
question
Which of the following statements will correctly add elements from an array to a listbox?
answer
lstDisplay.Items.Add(item)
Unlock the answer
question
Which of the following statements correctly declares an array?
answer
Dim intNumArr(3) As Integer
Unlock the answer
question
Which of the following statements correctly declares an array?
answer
Dim strNameArr() As String = {"Jon", "Joe", "Anne"}
Unlock the answer
question
Which of the following loops will traverse the strNameArr array?
answer
For i As Integer = 0 To strNameArr.Length - 1
Unlock the answer
question
Which of the following statements will sort the array intNumArr in ascending order?
answer
Array.Sort(intNumArr)
Unlock the answer
question
Which of the following statements would result in the following output from the ZooArr?
Zebra Monkey Chimp
answer
Array.Reverse(ZooArr)
Unlock the answer
question
Which of the following code segments would re-declare an array, keeping its existing values?
answer
ReDim Preserve strZooArr(9) As String
Unlock the answer
question
Which of the following code segments would add all values to a ListBox?
answer
For Each Animal in strZooArr lstZoo.Items.Add(Animal) Next Animal
Unlock the answer
question
Given the following statements, what is the output displayed in the label?
Dim strWord1 = "Zebra" Dim strWord2 = "Monkey" If strWord1.equals(strWord2) Then lblResult.Text = "The words are the same." else lblResult.Text = "The words are different." End If
answer
the words are different
Unlock the answer
question
Given a string variable called strWord, what statement will return the last letter in the string?
answer
strWord.Chars(strWord.Length - 1)
Unlock the answer
question
The properties and methods of a class are called __________________.
answer
members
Unlock the answer
question
Given the following statements, what is the value of chrLetter after the statements execute?
Dim strCourse As String = "Programming" Dim chrLetter As Char chrLetter = strCourse.Chars(4)
answer
r
Unlock the answer
question
Given the following statements, what is the value of intNumChars after the statements execute?
Dim strCourse As String = "Programming" intNumChars = strCourse.Length
answer
11
Unlock the answer
question
Which method of the String class converts a String object to all uppercase letters?
answer
toUpper
Unlock the answer
question
Given the following statements, what is the value of strNew after the statements execute?
Dim strName As String = "GeorgeWashington" Dim strNew As String strNew = strName.Replace("Washington"," Smith")
answer
George Smith
Unlock the answer
question
Given the following statements, what is the value of strFullName after the statements execute?
Dim strFirstName As String = "Joe" Dim strLastName As String = "Smith" Dim strFullName As StringM strFullName = strFirstName & " " & strLastName
answer
Joe Smith
Unlock the answer
question
Given the following statements, what is displayed in the label?
Dim intNum As Integer = 25 Dim intSqRtNum As Integer intSqRtNum = Math.Sqrt(intNum) Me.lblAnswer.Text = intSqRtNum.ToString()
answer
5
Unlock the answer
question
Given the following statements, what is displayed in the label?
Dim intNum As Integer = -6 Dim intAbsNum As Integer intAbsNum = Math.Abs(intNum) Me.lblAnswer.Text = intAbsNum.ToString()
answer
6
Unlock the answer
question
Given the following statements, what is displayed in the label?
Dim dblNumber As Double = 78.9878164894561 Dim dblRoundedNum As Double dblRoundedNum = Math.Round(dblNumber, 3) Me.lblAnswer.Text=dblRoundedNum.ToString()</blockquote
answer
78.988
Unlock the answer
question
The statement strAmount=strNewAmt.TrimEnd()
answer
removes all spaces from the end of the string
Unlock the answer
question
Given a string (strWord) entered into an InputBox, what statement will always return the first letter of that string?
answer
chrFirstLetter = strWord.Chars(0)
Unlock the answer
question
Given the following code, what is displayed in the label?
Dim strOrig As String = "Apex" Dim strNew As String strNew = strOrig.Insert(1, "s") lblAnswer.Text = strNew
answer
Aspex
Unlock the answer
question
Given the following statements, what is the output displayed in the label?
Dim strWord1 = "monkey" Dim strWord2 = "Monkey" If strWord1.equals(strWord2) Then lblResult.Text = "The words are the same." else lblResult.Text = "The words are different." End If
answer
The words are different
Unlock the answer
question
What is the result of the following code?
Dim strFullName As String = "" Dim strFirstName As String = "Joe" Dim strLastName As String = "Johnson" strFullName As String = String.Concat(strFirstName, strLastname) lblShowName.Text = strFullName
answer
JoeJohnson
Unlock the answer
question
Given the code below, what is the output in the label?
Dim strA As String = "Pink" Dim strB As String = "Orange" If String.Compare(strA, strB) = 0 Then lblAnswer.Text = strA & " is equal to " & strB ElseIf String.Compare(strA, strB) < 0 Then lblAnswer.Text = strA & " comes before " & strB ElseIf String.Compare(strA, strB) > 0 Then lblAnswer.Text = strA & " comes after " & strB End If
answer
Pink comes after orange
Unlock the answer
question
What would be the result of the expression String.Compare(strA, strB) given the following declarations?
Dim strA As String = "Hello" Dim strB As String = "Goodbye"
answer
>0
Unlock the answer
question
What is the value of intPosition given the following code?
Dim intPosition As Integer = 0 Dim strWord As String = "Apple" intPosition = strWord.IndexOf("p")
answer
1
Unlock the answer
question
Which is NOT an Image file format used in Visual Basic?
answer
TOP
Unlock the answer
question
Which SizeMode property may distort some images because it sizes an image to fit the picture box?
answer
Stretch Image
Unlock the answer
question
Which PictureBox control property can be set to False to hide an image?
answer
Visible
Unlock the answer
question
When an image is tiled on a form, is it
answer
represented to fill the form
Unlock the answer
question
The timer control Interval property is specified in
answer
milliseconds
Unlock the answer
question
What type of procedure is coded for each timer object added to an application?
answer
a tick even procedure
Unlock the answer
question
What does the "2" represent in the statement Dim DrawPen As New Pen (Color.Blue, 2)?
answer
the line thickness
Unlock the answer
question
The upper-left corner of a drawing surface is represented by the coordinates
answer
(0,0)
Unlock the answer
question
As you increase the y-coordinate of a PictureBox, you move _________.
answer
down
Unlock the answer
question
Which of the following assignment statement would set the maximum width of a label called lblSurface?
answer
maxWidth = lblSurface.Width
Unlock the answer
question
Which of the following statements will set the image called Puppy in the PictureBox?
answer
picAnimal.Image = My.Resources.Puppy
Unlock the answer
question
Which of the following statements will set sizemode of the PictureBox so that it resizes to fit the image?
answer
picImage.SizeMode = PictureBoxSizeMode.AutoSize
Unlock the answer
question
Which statement will set the interval of a timer to 5 seconds?
answer
tmr5Sec.Interval = 5000
Unlock the answer
question
Which of the following statements will tell the timer to start?
answer
tmrTimer.Start()
Unlock the answer
question
Which of the following statements will declare a label to be a drawing surface?
answer
Dim Surface As Graphic = lblSurface.CreateGraphics
Unlock the answer
question
Which of the following statements will draw a filled rectangle?
answer
surface.FillRectangle(RedBrush, 50, 50, 100, 50)
Unlock the answer
question
Which of the following statements would draw a filled half circle?
answer
FormSurface.FillPie(redBrush, 0, 200, 50, 50, 0, 180)
Unlock the answer
question
Which of the following statements would clear a drawing surface
answer
surface.Clear(Me.Backcolor)
Unlock the answer
question
Which of the following statements will declare a blue brush?
answer
Dim BlueBrush As New SolidBrush(Color.Blue)
Unlock the answer
question
Which of the following statements will correctly declare a points array?
answer
Dim CurvePoints() As Point = {New Point(10, 30), New Point(35, 35), New Point(75, 80), New Point(120, 20)}
Unlock the answer