Computer Programming I: Input Box, Character Variable, Loop – Flashcards

Unlock all answers in this set

Unlock answers
question
The binary number 10111 is ______ in decimal.
answer
23
question
The decimal number 15 equals ________ in binary.
answer
1111
question
Which number system utilizes only two digits?
answer
Binary
question
The decimal number 10 is equal to ________ in binary?
answer
1010
question
Digits in binary are also know as bits
answer
True
question
________ is another name for Decimal.
answer
Base 10
question
101 in base 2 equals ______ in decimal.
answer
5
question
What base number system is also known as hexadecimal?
answer
16
question
The F in hexadecimal is equal to
answer
15
question
The binary number 1000110 equals ________ in hexadecimal.
answer
46
question
The hexadecimal number A41 is ________ in binary
answer
101001000001
question
If a zero is shown in binary, it represents
answer
off
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
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.
question
What law protects against copyright infringement?
answer
The NET Act of 1977
question
This act restricts the way in which personal data can be used by federal agencies.
answer
The privacy act of 1974
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
question
Marketing technique where data is collected about customers visiting a website
answer
Online profiling
question
Text file created by the server computer when a user enters information into a website.
answer
Cookie
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
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
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
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
question
Which of the following would not be in an Acceptable Use Policy?
answer
You may access, upload, download, or distribute materials.
question
Which of the following does not deal with ergonomics?
answer
power and paper waste
question
Which of the following does deals with computers in the workplace?
answer
employee monitoring
question
A program that is able to reproduce itself over a network
answer
worm
question
What are the five steps of the programming process?
answer
  1. Identify the Problem
  2. Design the Solution
  3. Write the Program
  4. Test the Program
  5. Document and Maintain the Program
question
What are English-language statements that describe the processing steps of a program in paragraph form?
answer
pseudocode
question
What are the part/s of identifying the problem?
answer
Requirement and Specifications
question
What is most frequently used design in the programming process?
answer
Top-Down Design
question
___________________ is breaking down a problem into smaller sub-problems.
answer
Modularization
question
What is an algorithm?
answer
A set of steps that create an ordered approach to a problem solution
question
The proper use of syntax in a programming language is called ____________.
answer
programming style
question
All of the following are part of testing except
answer
deployment
question
hich of the following is the proper way to write a single line comment in Visual Basic?
answer
'Visual Basic
question
All of the following are reasons for commenting in your code except
answer
You are creating user documentation.
question
Which of the following is an example of pseudocode?
answer
If button is clicked then add the numbers else &nbsp
question
Which of the following is an algorithm?
answer
  1. Click the button
  2. Add the numbers
  3. Show the answer
question
In a Flowchart, what indicates the flow of logic?
answer
direction of the arrow
question
Testing for all syntax errors is called:
answer
debugging
question
The following is an example of what?
    1. Proceed down Main Street for two miles
Turn left on Ocean Drive,
  • Proceed on Ocean Drive for three blocks, to the fork.
  • IF left turn at fork is blocked THEN
  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
answer
IFTHENELSE Control Structure
question
The following is an example of what?
Wash hair. Rinse. Repeat.
answer
A DOWHILE infinite loop
question
Which window displays the application interface and allows objects to be added, deleted, and sized?
answer
the design window
question
Which area of the IDE contains controls that are used to create objects on the interface?
answer
the toolbox
question
Which area of the IDE is used to switch between the Design and Code windows?
answer
the solution explorer window
question
Which area of the IDE is used to change the text displayed in a Label object?
answer
the properties window
question
To size an object:
answer
select it and then drag a handle
question
Which is not a property of the Label control?
answer
style
question
Which object is used to group related radio buttons?
answer
a groupbox object
question
Which control object should be used when the user must select only one option from a set of options?
answer
radiobutton
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
question
What contains the controls that are used to create objects on the interface?
answer
The toolbox
question
________________ define the appearance, behavior, position and more of a control.
answer
properties
question
A graphical object that contains a title bar, a system menu and minimize, maximize and close buttons.
answer
form
question
This property sizes the label to fit the text
answer
autosize
question
Which segment of code correctly sets the Text property of the Label to "Programming rocks!"
answer
lblMessage.Text = "Programming rocks!"
question
Which segment of code correctly puts the message "Programming Rocks!" on two lines?
answer
lblMessage.Text = "Programming" & vbCrlf & "Rocks!"
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
question
Select the prefix that goes with the control.
answer
=RadioButton -> rad =GroupBox -> grp =CheckBox -> chk =Button -> btn =Label -> lbl
question
Which property will evaluate to whether or not a radio button has been selected?
answer
radProgram.checked
question
Which of the following statements is false given the image?
 
answer
The Autosize property is set to false
question
Given the following code, which RadioButton has been selected?
radChocolate.Checked = true radStrawberry.Checked = false radVanilla.Checked = false
answer
radChocolate
question
A variable is a named memory location that stores a value.
answer
true
question
Multiple variables with the same data type can be declared in a single statement.
answer
true
question
A variable can store more than one value at any given time.
answer
false
question
A local declaration allows a variable to be used anywhere in the module or form
answer
false
question
Which object allows users to enter values?
answer
a textbox object
question
A label placed near a text box that describes its contents or purpose is called a
answer
prompt
question
The TextBox control Name property
answer
identifies a control for the programmer
question
The TextBox control Text property
answer
determines what text is displayed in the text box
question
A named memory location which stores a value that cannot be changed from its initial assignment is called a
answer
constant
question
Which data type should be used to represent values with a decimal portion?
answer
double
question
Which data type should be used to represent single characters?
answer
char
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
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
question
Which statement correctly assigns the value 5 to the variable intNum?
answer
intNum = 5
question
Which statements correctly declare a variable and initialize it (give it a starting value)? There are more than one.
answer
...
question
Which statement correctly uses the ToString method?
answer
lblTotal.Text = decTotal.ToString("$###.##")
question
Which statement correctly uses the format function?
answer
Me.lblAnswer.Text = Format(intNum, "Standard")
question
Which statement correctly displays a messagebox with the message "Programming is awesome!"?
answer
MessageBox.Show("Programming is awesome!")
question
When you want a variable, like a counter, to hold its value, it should be declared as ___.
answer
static
question
Writing your code to allow for unexpected input from the user is called ____________.
answer
program debugging
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
question
The _____________ allows the coder to track the value of variables as the program is being executed.
answer
watch window
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
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
question
Which program segment correctly demonstrates program debugging?
answer
Try dblInput = Convert.ToDouble(txtInput.Text) Catch MessageBox.Show("Enter numeric input.") End Try
question
Which of the following tools can NOT be used for programmer debugging?
answer
Try...Catch
question
How do you access the Locals watch window if it is closed?
answer
debug menu
question
This debugging control tells the compiler to move to the next line of code in the programming block
answer
step into
question
Which of the following lines of code are optional?
Try statements Catch Ex As Exception statements Finally statements End Try
answer
Finally
question
Given the following statements:
If intGuess = intSecretNum Then Me.lblMessage.Text="You guessed it!" Else Me.lblMessage.Text="Try again" End If
What is displayed when intGuess is 35 and intSecretNum is 48?
answer
try again
question
Which statement should be used to decide among three or more actions?
answer
If...Then...ElseIf statement
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 Select
What message would be displayed if intQuantity is 16?
answer
Num is less than 20
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
question
Which statement generates random numbers in the range from 1 to 50?
answer
Next(1, 50)
question
Which is not a logical operator
answer
if
question
Which statement displays the following message box?
answer
MessageBox.Show("Try again")
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 If
What is displayed when the statements execute?
answer
great job
question
Which for the following statements will short circuit correctly?
answer
If dblGPA >= 3.5 AndAlso intSAT >=1200
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
question
What shows the possible outcomes of a compound Boolean expressions?
answer
truth table
question
What is the order of evaluation with logical operators?
answer
Not, And, Or
question
Which of the following Case statements is written incorrectly?
answer
Case < 10
question
Which of the following Case statements is written correctly?
answer
Case 1 to 10
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
question
Which statement/s are properly written to increment a counter variable by 1?
answer
counter=counter+1 counter+=1
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
question
Which function is used to convert an entry from an input box to an Integer?
answer
Convert.ToInt32()
question
Which statement correctly updates the accumulator intSum (syntax)?
answer
intSum = intSum + intNum
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
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
question
Which of the following statements about an accumulator is false?
answer
An accumulator is a value that is incremented by the same value.
question
What is an iteration?
answer
The execution of the loop one time
question
Which loop is a posttest loop?
answer
Do ...Loop While
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
question
Which code segment correctly checks to see if input was entered before looping?
answer
Do While (strEntered <> Nothing) Loop
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)
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
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
question
What is a condition used to signify that a loop should stop executing?
answer
sentinental
question
Which statement will correctly get input from a user using an InputBox?
answer
strInput = InputBox("Enter something", "Input Example")
question
When should you use an accumulator?
answer
When you want to add a changing amount to the variable.
question
Which loop structure will always loop at least once?
answer
Do...Loop While
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
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
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.
question
Which control displays a list from which the user can select one or more items?
answer
listbox
question
Which code segment would return true if the user selected "Puppy"?
answer
if lstAnimals.SelectedItem = "Puppy" Then . . .
question
Which of the following statements will check to see if "Yellow" has been selected from the ListBox?
answer
if lstColors.SelectedIndex = 1 Then . . .
question
Which control would allow a user to select from a list as well as enter input?
answer
combobox
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
question
Which statement would hide the ComboBox?
answer
cboZoo.Visible = false
question
Which statement would sort the ListBox?
answer
lstColors.Sorted = true
question
Which statement will clear all items from the ListBox?
answer
lstChoices.Items.Clear()
question
What happens to a ListBox if the list entered is longer than the ListBox?
answer
A scrollbar is automatically added.
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.
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
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 ...
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.
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
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
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
question
Given the following statements:
Dim intX As Integer For intX = 1 To 12 MessageBox.Show(intX) Next intX
How many message boxes will be displayed?
answer
12
question
Which statement displays the following message box?
answer
MessageBox.Show("Try again")
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 . . .
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"))
question
Which statement correctly displays a user-defined DialogBox?
answer
AboutForm.Show()
question
What is the data type of the value returned from an InputBox?
answer
string
question
An event procedure is a Sub procedure written for a specific object event.
answer
true
question
A variable or value passed to a sub is called a formal parameter.
answer
false
question
Arguments passed by value MUST be constants.
answer
false
question
Postconditions should be included with every sub
answer
true
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
question
The location in memory where its value is stored is its address.
answer
true
question
The event procedure's name affects the procedure execution.
answer
false
question
How many arguments are passed in the statement:
calculate (intNumerator, intDenominator, dblAnswer)
answer
3
question
The arguments in call statement must
answer
correspond in order to the parameters in the procedure being called
question
Function procedures
answer
perform a specific task and then return a value
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
question
What statement/s must be true when a sub completes execution?
answer
postcondition
question
Which statement can be used to execute a sub procedure?
answer
call
question
The breaking up of a program is called ______________
answer
modularization
question
All of the following are advantages of dividing a program into parts except
answer
more code redundancy
question
=Private Sub getName (ByVal strFName As String, ByVal strLName As String)
answer
Private Sub getName (ByVal strFName As String, ByVal strLName As String)
question
Which sub header is written correctly?
answer
Private Sub getNums (ByVal intFirstNum As Integer, ByVal intSecNum As Integer)
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)
question
Which of the following headers is written correctly?
answer
Function isInteger (ByVal intNum As Integer) As Integer
question
Which of the following code segments will correctly call the function getArea if it has two parameters?
answer
intAnswer = getArea (intNum1, intNum2)
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
question
What is Values.Length given the statement
Dim Values() As Integer = {5, 8, 3, 9, 2}
answer
5
question
What will occur when an invalid array index is used in a statement?
answer
a run time error will occur
question
The length of the array class returns
answer
the number of elements in an array
question
Given the following statements:
Dim strFirstName(5) As String strFirstName(6)="John"
The strFirstName(6)="John" statement
answer
causes a run time error
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
question
Which statement changes the size of an existing array at run time?
answer
he ReDim Statement
question
The ReDim Preserve Statement is used to___.
answer
Keep the existing values in an array when sizing it
question
Which Call statement properly passes an array?
answer
Call SumValues(intArray)
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 Sub
Which is displayed in the label when the code is executed?
answer
220
question
Which statement is false?
answer
The elements in an array are initialized to 1 if they are of type Integer
question
Which is an example of an index?
answer
3
question
How many array elements are declared in the statement: Dim students() as String = {"Leslie", "Chris", "Julie"}?
answer
3
question
Which are the index values associated with the array declaration below? Dim students() as String = {"Leslie", "Chris", "Julie"}
answer
0,1,2
question
Which of the following statements correctly declares and initializes an array?
answer
Dim strArray() As String = {"Tim", "Joe", "Alan", "Tom"}
question
Which of the following For Each statements is written correctly?
answer
For Each name As String In NameArr
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
question
Which of the following statements will correctly add elements from an array to a listbox?
answer
lstDisplay.Items.Add(item)
question
Which of the following statements correctly declares an array?
answer
Dim intNumArr(3) As Integer
question
Which of the following statements correctly declares an array?
answer
Dim strNameArr() As String = {"Jon", "Joe", "Anne"}
question
Which of the following loops will traverse the strNameArr array?
answer
For i As Integer = 0 To strNameArr.Length - 1
question
Which of the following statements will sort the array intNumArr in ascending order?
answer
Array.Sort(intNumArr)
question
Which of the following statements would result in the following output from the ZooArr?
Zebra Monkey Chimp
answer
Array.Reverse(ZooArr)
question
Which of the following code segments would re-declare an array, keeping its existing values?
answer
ReDim Preserve strZooArr(9) As String
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
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
question
Given a string variable called strWord, what statement will return the last letter in the string?
answer
strWord.Chars(strWord.Length - 1)
question
The properties and methods of a class are called __________________.
answer
members
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
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
question
Which method of the String class converts a String object to all uppercase letters?
answer
toUpper
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
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
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
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
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
question
The statement strAmount=strNewAmt.TrimEnd()
answer
removes all spaces from the end of the string
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)
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
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
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
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
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
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
question
Which is NOT an Image file format used in Visual Basic?
answer
TOP
question
Which SizeMode property may distort some images because it sizes an image to fit the picture box?
answer
Stretch Image
question
Which PictureBox control property can be set to False to hide an image?
answer
Visible
question
When an image is tiled on a form, is it
answer
represented to fill the form
question
The timer control Interval property is specified in
answer
milliseconds
question
What type of procedure is coded for each timer object added to an application?
answer
a tick even procedure
question
What does the "2" represent in the statement Dim DrawPen As New Pen (Color.Blue, 2)?
answer
the line thickness
question
The upper-left corner of a drawing surface is represented by the coordinates
answer
(0,0)
question
As you increase the y-coordinate of a PictureBox, you move _________.
answer
down
question
Which of the following assignment statement would set the maximum width of a label called lblSurface?
answer
maxWidth = lblSurface.Width
question
Which of the following statements will set the image called Puppy in the PictureBox?
answer
picAnimal.Image = My.Resources.Puppy
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
question
Which statement will set the interval of a timer to 5 seconds?
answer
tmr5Sec.Interval = 5000
question
Which of the following statements will tell the timer to start?
answer
tmrTimer.Start()
question
Which of the following statements will declare a label to be a drawing surface?
answer
Dim Surface As Graphic = lblSurface.CreateGraphics
question
Which of the following statements will draw a filled rectangle?
answer
surface.FillRectangle(RedBrush, 50, 50, 100, 50)
question
Which of the following statements would draw a filled half circle?
answer
FormSurface.FillPie(redBrush, 0, 200, 50, 50, 0, 180)
question
Which of the following statements would clear a drawing surface
answer
surface.Clear(Me.Backcolor)
question
Which of the following statements will declare a blue brush?
answer
Dim BlueBrush As New SolidBrush(Color.Blue)
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)}
Get an explanation on any task
Get unstuck with the help of our AI assistant in seconds
New