CS 146 Quiz 3

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

The symbol for the string concatenation operator is

&

Suppose the Double variable num has the value 123.4567. What value will the following statement assign to num? num = Math.Round(num, 2)

123.46

What value will be assigned to the numeric variable x when the following statement is executed? x = 2 + 3 * 4

14

Given x = 3 and y = 1, what value will be assigned to the Double variable w when the following statement is executed? w = (x + y) / (x - y)

2

What will be the contents of the variable x after the following statement is executed? x = Math.Sqrt(((9 + 7) / (4 * 2)) + 2)

2

What will be the output of the following line? txtBox.Text = "2" & 3

23

What is the value of Int(8.9)?

8

What will be displayed when the following lines are executed? Dim x As Double = 3 y As Double = 1 Dim z As Double z = x + (y * x) x = y z = x + z lstBox.Items.Add(x + y + z)

9

Suppose Option Strict On is used and the variable balance is declared as double. The following statement will assign the content of the text box to balance correctly. balance = txtbox.Text

False

The following two statements are equivalent. var1 = var2 var2 = var1

False

The statement a + b = c assigns to c the sum of the values of a and b.

False

What message will be displayed by the following statement: MessageBox.Show("This is a test.", "Test")

This is a test.

The following statement is valid. c += 1

True

The following statement is valid. y = y + 72

True

The value of (11 Mod 2) is 1.

True

Which of the following statements removes all text from lstBox?

lstBox.Items.Clear()

Which statement prompts the user for a name and then assigns the name to the string variable strName?

strName = InputBox("What is your first name?", "First Name")

Which statement can be used to clear the contents of a text box?

txtBox.Text = ""

Which statement will display the words "Hello World" in a text box?

txtBox.Text = "Hello" & " World"

What is the correct syntax for displaying the value of the String variable myString in a text box?

txtBox.Text = myString


Ensembles d'études connexes

Types of Hotels - Targeting specific markets and offering specific amenities.

View Set

Chapter 15: Nursing Care of the Child with an Infection

View Set

Comm 301 Chapter 1- University of Delaware

View Set