If the user types an invalid value into a textbox and moves


1. If the user is typing data into a TextBox and types an invalid character, which of the following actions would be inappropriate for the program to take?

a. Change the TextBox's background color to indicate the error.
b. Silently discard the character.
c. Display an asterisk next to the TextBox to indicate the error.
d. Display a message box telling the user that there is an error.

2. If the user types an invalid value into a TextBox and moves focus to another TextBox, which of the following actions would be inappropriate for the program to take?

a. Force focus back into the TextBox that contains the error.
b. Change the first TextBox's background color to indicate the error.
c. Change the first TextBox's font to indicate the error.
d. Display an asterisk next to the first TextBox to indicate the error.

3. If the user enters some invalid data on a form and then clicks the form's Accept button, which of the following actions would be appropriate for the program take?

a. Change the background color of TextBoxes containing invalid values to indicate the errors.
b. Display a message box telling the user that there is an error.
c. Do not close the form until the user corrects all the errors.
d. All the above.

4. Which of the following methods returns true if a regular expression matches a string?

a. Regex.Matches
b. Regex.IsMatch
c. Regexp.Matches
d. String.Matches

5. Which of the following regular expressions matches the Social Security number format ###-##-#### where # is any digit?

a. ^###-##-####$
b. ^\d3-\d2-\d4$
c. ^\d{3}-\d{2}-\d{4}$
d. ^[0-9]3-[0-9]2-[0-9]4$

6. Which of the following regular expressions matches a username that must include between 6 and 16 letters, numbers, and underscores?

a. ^[a-zA-Z0-9_]?{6}$
b. ^[a-zA-Z0-9_]{6,16}$
c. ^[A-Z0-9a-z_]?$
d. ^\w{16}?$

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: If the user types an invalid value into a textbox and moves
Reference No:- TGS01520261

Now Priced at $25 (50% Discount)

Recommended (99%)

Rated (4.3/5)