Shared Flashcard Set

Details

Visual Basic
Ch 3 Lesson B & C
14
Computer Science
Undergraduate 1
03/31/2008

Additional Computer Science Flashcards

 


 

Cards

Term

The InputBox function displays a dialog box containing which of the following?

 

a.  cancel button

b.  input area

c.  OK button

d.  prompt

e.  All of the above 

Definition
E.  All of the above
Term

Which of the following is the concatenation operator?

 

a.  @

b.  #

c.  $

d.  &

e.  * 

Definition
D.  &
Term

Assume the region1 variable contains the string "North" and the region2 variable contains the string "West".  Which of the following will display the string "NorthWest" (one word) in the uiRegionLabel control?

 

a.  Me.uiRegionLabel.Text= region1 & region2

b.  Me.uiRegionLabel.Text = "region1" & "region2"

c.  Me.uiRegionLabel.Text = region1 $ region2

d.  Me.uiRegionLabel.Text = region1 # region2

e.  Me.uiRegionLabel.Text = region1 @ region2 

Definition
a.  Me.uiRegionLabel.Text = region1 & region2
Term

Assume the cityName variable contains the string "Boston" and the stateName variable contains the string "MA".  Which of the following will display the string "Boston, MA" (the city, a comma, a space, and the state) in the uiAddressLabel control?

 

a.  Me.uiAddressLabel.Text = cityName #, & stateName 

b.  Me.uiAddressLabel.Text = "cityName" & ", " & "stateName"

c.  Me.uiAddressLabel.Text = cityName $ ", " $ stateName

d.  Me.uiAddressLabel.Text = cityName & ", " & stateName

e.  Me.uiAddressLabel.Text = "cityName," & "stateName" 

Definition

D.  uiAddressLabel.Text = cityName & ", " & stateName 

Term

Which of the following intrinsic constants advances the insertion point to the next line?

 

A.  Advance

b.  ControlChars.Advance

c.  ControlChars.NewLine

d.  ControlChars.NextLine

e.  None of the above 

Definition
C.  ControlChars.NewLine
Term

If you want to give the user the ability to select a specific buttion when the button does not have the focus, set the form's _____ property to the name of the button.

a.  AcceptButton

b.  DefaultButton

c.  EnterButton

d.  FocusButton

e.  None of the above 

Definition
A.  AcceptButton
Term

Which of the following statements prompts the user for a number, and the correctly assigns the user's response to a double variable named number?

 

a.  InputBox("Enter a number:", "Number") = number

b.  number = Double.Parse(InputBox("Enter a number:", "Number"))

c.  number = InputBox("Enter a number:", "Number")

d.  number = Parse.Double(InputBox("Enter a number:", "Number")

e.  number = Double(InputBox("Enter a number:", "Number")) 

Definition
b.  number = Double.Parse(InputBox("Enter a number:", "Number"))
Term

Which of the following statements prompts the user for the name of a city, and then correctly assigns the user's response to a String variable named cityName?

 

a.  InputBox("Enter the city:", "City") = cityName

b.  cityName = chr(InputBox("Enter the city:", "City"))

c.  cityName = InputBox("Enter the city:", "City")

d.  cityName = String(InputBox("Enter the city:", "City")

e.  cityName = Val(InputBox("Enter the city:", "City")) 

Definition
c.  cityName = InputBox("Enter the city:", "City")
Term

The InputBox function's prompt argument should be entered using _____.

a.  book title capitalization

b.  sentence capitalization 

Definition
b.  sentence capitalization
Term

The InputBox function's title argument should be entered using _____.

a.  book title capitalization

b.  sentence capitalization 

Definition
a.  book title capitalization
Term

A _____ variable is a procedure-level variable that retains its value after the procedure in which it is declared ends.

 

a.  consistent

b.  constant

c.  static

d.  stationary

e.  term 

Definition
c.  static
Term

Which of the following statements declares a procedure-level variable that retains its value after the procedure in which it is declared ends?

 

a.  Const counter As Integer

b.  Dim counter As Constant

c.  Dim counter As Integer

d.  Static counter As Integer

e.  Term counter As Integer 

Definition
d.  Static counter As Integer
Term

The _____ event occurs when the contents of a text box have changed.

a.  Change

b.  Changed

c.  Text

d.  TextChange

e.  TextChanged 

Definition
e.  TextChanged
Term

Assume you have a procedure named GetNumber.  Which of the following instructions indicates that the procedure should be processed when the user clicks either the uiNum1TextBox or the uiNum2TextBox?

a.  Private Sub GetNumber(ByVal sender As Object, ByVal e As System.EventArgs) Handles uiNum1TextBox.Click, uiNum2TextBox.Click

b.  Private Sub GetNumber(ByVal sender As Object, ByVal e As System.EventArgs) Handles uiNum1TextBox, uiNum2TextBox

c.  Private Sub GetNumber(ByVal sender As Object, ByVal e As System.EventArgs) Handles uiNum1TextBox.Click and uiNum2TextBox.Click

d.  Private Sub GetNumber(ByVal sender As Object, ByVal e As System.EventArgs) Handles Click for uiNum1TextBox, uiNum2TextBox

e.  None of the above. 

Definition
a.  Private Sub GetNumber(ByVal sender As Object, ByVal e As System.EventArgs) Handles uiNum1TextBox.Click, uiNum2TextBox.Click
Supporting users have an ad free experience!