Chapter 04

# Chapter 04 - Chapter 4 _b_ 1. Which of the following code...

This preview shows pages 1–3. Sign up to view the full content.

Chapter 4 __b__ 1. Which of the following code segments assigns the string “Great Year” to a label named lblMessage when the value in the variable sngSales is either greater than 50,000, or equal to 50,000? a. If sngSales > 50000 Then lblMessage.Text = “Great Year” End If b. If sngSales >= 50000 Then lblMessage.Text = “Great Year” End If c. If sngSales < 50000 Then lblMessage.Text = “Great Year” End If d. If sngSales <= 50000 Then lblMessage.Text = “Great Year” End If __c__ 2. Suppose you want to determine whether a variable, sngPayAmount, is between 1200 and 1400, inclusively. If it is, you want to set lblMessage text to “Pay amount is in the range”. Which of the following code segments will accomplish this? a. If sngPayAmount >=1200 And <= 1400 Then lblMessage.Text = “Pay amount is in the range” End If b. If sngPayAmount <=1200 Or sngPayAmount >= 1400 Then lblMessage.Text = “Pay amount is in the range” End If c. If sngPayAmount >=1200 And sngPayAmount <=1400 then lblMessage.Text = “Pay amount is in the range” End If d. If sngPayAmount > 1200 Or sngPayAmount < 1400 Then .Text = “Pay amount is in the range” End If __c__ 3. Visual Basic uses values to represent characters such as A, B, and C in memory. a. ASCII code b. BCD code c. Unicode d. ISO code 20

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
__c__ 4. Suppose you want to check that the user has entered a value into a text box named txtBox. Your code should respond with an appropriate message if the user does not enter a value. Which of the following code segments does this? a. If txtBox.text = " " Then MessageBox.Show(“No data has been entered”) End If b. If txtBox.Text <> "blank" Then MessageBox.Show(“ data has been entered”) End If c. If txtBox.Text = String.Empty Then MessageBox.Show(“No data has been entered”) End If d. If txtBox <> String.Empty Then MessageBox.Show(“data has been entered”) End If ____ 5. To convert a copy of a String to all uppercase letters, use the method of the String object. a. ConvertToUpper b. ToUpper c. ToString d. ToUpperCase ____ 6. Which of the following functions accepts a String as its argument and returns True if the string contains only numeric digits? a. IsNumber b. IsNumeric c. CStr d. ToString ____ 7. Which of the following statements removes the spaces at the end of a String named strAddress and assigns the result to label lblAddress? a.
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/01/2011 for the course ITSE 1431 taught by Professor Gibson during the Spring '10 term at Central Texas College.

### Page1 / 9

Chapter 04 - Chapter 4 _b_ 1. Which of the following code...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online