VB Quiz - Section 3.3 - Input and Output

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

What will be the output of the following statement? txtBox.Text = (1234.567).ToString("C")

(A) $1234.567 (B) 1,234.57 (C) $1234.57 (D) $1,234.57 D

Which of the following masks is appropriate for a masked text box into which the user will enter a license plate consisting of two digits followed by 4 letters?

(A) &&LLLL (B) &&&&&& (C) 00LLLL (D) None of the above C

What will be the output of the following statement? txtBox.Text = (2 / 3).ToString("P4")

(A) 0.6666 (B) 0.6667 (C) 66.66% (D) 66.6667% D

The value of (#1/1/2017#).ToString("D") is:

(A) 01/01/2017 (B) January 1, 2017 (C) January 01, 2017 (D) Sunday, January 1, 2017 D

Suppose you are 20 years old, num is an integer variable, and the statement num = 1 + CInt(InputBox("How old are you?")) is executed and responded to? What will be the output of txtBox.Text = num & " years old"

(A) 1 + "How old are you?" (B) Syntax error (C) 20 years old (D) 21 years old D

If the value of the Date variable currently is the first day of 2017, then what is displayed by the statement txtBox.Text = CStr(currently.AddMonths(1))?

(A) 1/2/2017 (B) 2/1/2017 (C) February 1, 2017 (D) Tuesday February 1, 2017 B

What will be the output of the following statement? txtBox.Text = (1234.56789).ToString("N3")

(A) 1234.568 (B) 1230 (C) 1,234.568 (D) 1,230 C

Which of the following is not used to assign a value to a variable?

(A) InputBox statement (B) Dim statement (C) an assignment statement (D) MessageBox.Show statement D

What is the proper syntax when using a message dialog box?

(A) MessageBox.Show("Hi there", "Hi") (B) MessageBox.Show(Hi there, Hi) (C) MessageBox.Show "Hi There", "Hi" (D) MessageBox.Show Hi There, Hi A

If TAX_RATE is a named constant of type Decimal, which of the following statements is valid?

(A) TAX_RATE += 1 (B) dblVar = TAX_RATE + 1 (C) TAX_RATE = 2 * TAX_RATE (D) All of the above B

What is displayed in the title bar of the message dialog box by the following statement? MessageBox.Show("This is a test.", "Test")

(A) This is a test. (B) Nothing. (C) Test (D) The same as the name of the program. C

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

(A) This is a test. (B) Nothing. (C) Test (D) This is a test. Test A

Which statement assigns today's date to the Date variable currently?

(A) currently = #Now# (B) currently = #Today# (C) currently = Now (D) currently = Today D

Which statement assigns the date of the first day of the year 2017 to the Date variable firstDay?

(A) firstDay = 1/1/2017 (B) firstDay = "1/1/2017" (C) firstDay = &1/1/2017& (D) firstDay = #1/1/2017# D

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

(A) strName = InputBox("What is your first name?", "First Name") (B) strName = MessageBox.Show("What is your first name?", "First Name") (C) InputBox("What is your first name?", "First Name") = strName (D) MessageBox.Show "What is your first name?", "First Name" = strName A

Named constants must have class scope. (T/F)

F

The value assigned to a class-level named constant can be changed in any procedure. (T/F)

F

Write a statement that produces a message dialog box with the words "US Motto" in its title bar and the message "E PLURIBUS UNUM".

MessageBox.Show("E PLURIBUS UNUM", "US Motto")

The line continuation character must be preceded with a space. (T/F)

T

The statement Const TAX_RATE As Decimal is not valid. (T/F)

T

The value of (12345).ToString("C") is $12,345.00. (T/F)

T

The value of DateDiff(DateInterval.Day, #1/1/2017#, #2/1/2018#) is 31. (T/F)

T

The value returned by InputBox is a string. (T/F)

T

When the Mask property of a masked text box is set to LL, at most two characters (consisting of letters or spaces) can be entered into the masked text box. (T/F)

T


Ensembles d'études connexes

Chapter 5.2 Explain the importance of applicable regulations, standards, or frameworks that impact organizational security posture

View Set

Chapter 3 PArt 2 Xcel Solutions Quiz

View Set

anatomy exam 2: bones and skeletal tissues

View Set

Chapter 7: Microbial Nutrition, Ecology, and Growth

View Set

Exam 2 - Skeletal System, Articulations/Joints, and Muscular System - ULTIMATE STUDY GUIDE COMBINED

View Set

F5 UT1 on 2/11: Dependent Prepositions 2 (adj + PREP)

View Set

American/AZ History Semester 2 Final

View Set

Series 66 -Laws, regs, and guidelines

View Set