Exam 3: Using Variables and Constants

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The value returned by the InputBox function depends on the button the user chooses.

(True/False)
4.7/5
(31)

A procedure in an application needs to store student data.The student first name,student last name,student GPA,and whether or not the student is registered all need to be stored.Write the appropriate Dim statements to declare the variables.Make sure to use appropriate naming conventions.

(Short Answer)
4.9/5
(38)

All numeric variables are automatically initialized to 0 if no initial value is specified when the variable is declared.

(True/False)
4.8/5
(35)

The assignment operator in Visual Basic is the ____ symbol.

(Multiple Choice)
4.7/5
(37)

Case 1 - PetPals You have been hired by PetPals Veterinary Clinic to modify an application. The application is used to enter and save all patient (pet) information obtained during an office visit. -The veterinarian wants to document and display the name of the technician who performs the initial evaluation of the pet.You decide to use an InputBox function to prompt the user to enter this data first.The InputBox function should be coded in the ____.

(Multiple Choice)
4.8/5
(40)

An application translates English words into French words and displays the results as a message in a Label control.The strEnglish variable contains the string "apple".The strFrench variable contains the string "pomme".Write an assignment statement to display the string "The French word for apple is pomme." in the lblMessage control.

(Short Answer)
4.8/5
(32)

A procedure in an application needs to store tax rate data.The county of residence and the tax rate need to be stored.Write the appropriate Dim statements to declare the variables.Write an assignment statement that assigns .08 to the tax rate variable.

(Short Answer)
4.8/5
(45)

Explain the scope and lifetime of variables.How are a variable's scope and lifetime determined? List the three scopes available for a variable.

(Essay)
4.8/5
(28)

Case 1 - PetPals You have been hired by PetPals Veterinary Clinic to modify an application. The application is used to enter and save all patient (pet) information obtained during an office visit. -The account number for each pet must be available to be used by all procedures in the form.You should make sure the account number is declared using the ____ keyword.

(Multiple Choice)
4.9/5
(42)

You create a named constant using the ____ statement.

(Multiple Choice)
5.0/5
(28)

Every numeric data type in Visual Basic has a ____ method that can be used to convert a string to that numeric data type.

(Multiple Choice)
4.7/5
(38)

What is a TextChanged event? How can it be used within an application?

(Essay)
4.9/5
(37)

The ____ of a variable determines where in the application's code a variable can be used.

(Multiple Choice)
4.8/5
(36)

A variable name must begin with a letter or a(n)____.

(Multiple Choice)
4.8/5
(44)

The following sample of code contains errors. Rewrite the incorrect statements to correct all errors. -Dim strPROMPT As String = "Please enter an employee code:" Const strTITLE As String = Employee Data 'assign the code to a variable strCode = InputBox(strTITLE,strPROMPT)

(Essay)
4.9/5
(46)

You cannot associate a procedure with more than one object or event.

(True/False)
4.8/5
(32)

An application allows a user to enter an employee code,a salary amount,and a bonus rate to be used in a calculation.The salary amount will always be a whole number,and the bonus rate may contain a decimal place.Write the appropriate Dim statements to declare the variables.Write the related statements needed to convert the strings entered by the user into numeric data types.

(Essay)
4.8/5
(34)

A named constant's value cannot be changed while the application is running.

(True/False)
5.0/5
(41)

A Boolean variable is initialized to the value True if no initial value is stated when the variable is declared.

(True/False)
4.8/5
(32)

The following sample of code contains errors. Rewrite the incorrect statements to correct all errors. -Private Sub btnCalc_Click(ByVal sender As Object,ByVal e As System.EventArgs)Handles btnCalc.Click ' calculates and displays the total amount owed for purchasing hats ' user enters number of hats and price per hat ' all hats are on sale for 25% off the price Dim dblNumHats As Integer Dim decHatPrice As Decimal Dim decDiscount As Double Dim decTotal As Decimal ' assign number of hats and price to variables Integer.TryPurse(txtNumHats.Text,intNumHats) Decimal.TryParse(txtHatPrice,decHatPrice) ' calculate and display the total amount owed decDiscount = decHatPrice * dblRATE decTotal = (intNumHats + decHatPrice)- decDiscount Total.Text = decTotal.ToString(C2) End Sub

(Essay)
4.7/5
(31)
Showing 21 - 40 of 60
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)