Sunday, August 2, 2009

Visual Basic Questions?

I am practicing some multiple choice questions before my final exam, could you please help me out. Thanks.


When defining a variable, the keyword ____ appears at the beginning of the statement.


a. Assign c. Define


b. Declare d. Dim











2. When defining a variable to be used to hold textual information containing multiple characters, the declaration statement should have ____ at the end of the statement.


a. As Char c. As String


b. As Char Type d. As String Type











3. A variable that will be used to hold only True or False values should be declared as a(n) ____ data type.


a. Boolean c. Integer


b. Decimal d. Single








4. A program whose interface will be a window on the screen of a computer running the Windows operating system, and which will allow the user to interact with the program by using this window, is created by selecting a ____ project in Visual Studio.


a. Web application c. Windows application


b. Console application d. Custom control














5. Properties can be displayed in the Properties window ____.


a. grouped by category or by the order they appear on the screen


b. grouped by category or sorted numerically


c. sorted alphabetically by name or grouped by size


d. sorted alphabetically by name or grouped by category














6. The ____ sign is used in an assignment statement.


a. plus (+) c. ampersand (%26amp;)


b. equal (=) d. percent (%)











7. Which of the following is the correct general format for assigning a value to a property?


a. propertyvalue = propertyname.objectname


b. propertyvalue = objectname.property


c. propertyname.objectname = propertyvalue


d. objectname.property = propertyvalue











8. The ____ feature displays all allowable entries you can make in a Visual Basic statement each time a dot, equal sign, or other special character required for the statement is typed.


a. AutoComplete c. IntelliComplete


b. AutoSense d. IntelliSense











9. When you type the word ____ followed by a period in the code editor, IntelliSense displays a list of all the entries, including all the objects that can be specified in the statement.


a. Me c. MyForm


b. My d. VB











10. A(n) ____ is used for denoting a comment statement.


a. semi-colon (;) c. apostrophe (‘)


b. period (.) d. comma (,)











11. Comments are displayed (by default) with ____.


a. a green squiggly line c. blue text


b. green text d. a blue squiggly line








12. The ____ prefix is used for a Menu object.


a. menu c. mst


b. mns d. mnu











13. The ____ character is used to indicate that a letter is a hot key on a menu item.


a. ampersand (%26amp;) c. back slash (\)


b. forward slash (/) d. underscore (_)











14. The hot key for a menu item can be activated with the keyboard by pressing the ____ key and the hot key at the same time.


a. ALT c. CTRL


b. SHIFT d. TAB











15. The ____ object provides a text box that asks the user for input and provides an input area.


a. label c. textbox


b. menu d. Radio button











16. Which line of code will add the value “East” to a ListBox object named lstDirections?


a. lstDirections.Add(“East”) c. lstDir...


b. lstDirections.Items.Add(“East”) d. ...











17. To remove all objects from a ListBox object, the ____ method is used.


a. Clear c. Empty


b. Items.Clear d. Items.Empty











18. The ____ property of a ListBox object identifies which item in the ListBox was selected.


a. Item c. Selected


b. ItemSelected d. SelectedItem











19. The compound operator ____ adds the value of the right operand to the value of the left operand and stores the result in the left operand’s variable.


a. ++ c. =+


b. += d. ==











20. The compound operator ____ is used to add a string to an existing string.


a. %26amp;= c. %26amp;%26amp;


b. =%26amp; d. ==








21. The ____ follows the keyword For in a For...Next loop.


a. keyword Next c. keyword To


b. keyword Step d. a control variable name











22. A For...Next loop with a beginning value of 1, an ending value of 25, and a step value of 3 will execute ____ times.


a. 3 c. 9


b. 8 d. 25











23. How many times will the following loop execute?


For intCount = 10 To 16 Step 2


‘Body of Loop


Next


a. 3 c. 6


b. 4 d. 7











24. How many times will the following loop execute?


For intCount = 10 To 1 Step -2


‘Body of loop


Next


a. 4 c. 9


b. 5 d. 10




















25. What will be the value of the variable intTotalCount when the following code is executed?


For intOuterCount = 1 to 5


For intInnerCount = 1 to 4


intTotalCount +=1


Next


Next


a. 4 c. 9


b. 5 d. 20

Visual Basic Questions?
1. dim


2. as string


3.boolean


4. Windows application


5.sorted alphabetically by name or grouped by category


6.equal (=)


7.objectname.property = propertyvalue


8.AutoSensed.IntelliSense


9.Mec.MyForm


10.apostrophe (‘)


11.green text


12.mnu


13.underscore (_)


14.ALT


15.textbox


16.lstDirections.Add(“East”)c....


17.Clear


18.SelectedItem


19.+=


20.%26amp;=


21.keyword To


22.9


23.4


24.5


25.5
Reply:Here are a few of them





1. d.


2. c.


3. a.


4. b.


5. d.


6. b.


7. d.


8. d.


9. b.


10. c.


11. b.


12. d.


13. a.


14. a.


15. c.


16.b.


17.b.


18.d.


19.b.


20.a


21.d.


22.c.


23.b.


24.b.


25.d


No comments:

Post a Comment