McqMate
These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Bachelor of Science in Computer Science TY (BSc CS) , Bachelor of Science in Computer Science (BSc CS) , Programming Languages .
1. |
The Visual Basic Code Editor will automatically detect certain types of errors as you are entering code. |
A. | true |
B. | false |
Answer» A. true |
2. |
Keywords are also referred to as reserved words. |
A. | true |
B. | false |
Answer» A. true |
3. |
The divide-and-conquer-method of problem solving breaks a problem into large, general pieces first, then refines each piece until the problem is manageable. |
A. | true |
B. | false |
Answer» A. true |
4. |
Visual Basic responds to events using which of the following? |
A. | a code procedure |
B. | an event procedure |
C. | a form procedure |
D. | a property |
Answer» B. an event procedure |
5. |
When the user clicks a button, _________ is triggered. |
A. | an event |
B. | a method |
C. | a setting |
D. | a property |
Answer» A. an event |
6. |
What property of controls tells the order they receive the focus when the tab key is pressed during run time? |
A. | focus order |
B. | focus number |
C. | tab index |
D. | control order |
Answer» C. tab index |
7. |
Sizing Handles make it very easy to resize virtually any control when developing applications with Visual Basic. When working in the Form Designer, how are these sizing handles displayed? |
A. | a rectangle with 4 arrows, one in each corner, around your control. |
B. | a 3-d outline around your control. |
C. | a rectangle with small squares around your control. |
D. | none of the above. |
Answer» C. a rectangle with small squares around your control. |
8. |
The Properties window plays an important role in the development of Visual Basic applications. It is mainly used |
A. | to change how objects look and feel. |
B. | when opening programs stored on a hard drive. |
C. | to allow the developer to graphically design program components. |
D. | to set program related options like program name, program location, etc. |
Answer» A. to change how objects look and feel. |
9. |
When creating a new application in Visual Basic, you are asked to supply a name for the program. If you do not specify a name, a default name is XXXXX XXXXX is this default name? |
A. | wapplication followed by a number. |
B. | application followed by a number. |
C. | windowsapplication. |
D. | windowsapplication followed by a number. |
Answer» B. application followed by a number. |
10. |
Which of the properties in a control’s list of properties is used to give the control a meaningful name? |
A. | text |
B. | contextmenu |
C. | controlname |
D. | name |
Answer» D. name |
11. |
An algorithm is defined as: |
A. | a mathematical formula that solves a problem. |
B. | a tempo for classical music played in a coda. |
C. | a logical sequence of steps that solve a problem. |
D. | a tool that designs computer programs and draws the user interface. |
Answer» C. a logical sequence of steps that solve a problem. |
12. |
A variable declared inside an event procedure is said to have local scope |
A. | true |
B. | false |
Answer» A. true |
13. |
A variable declared outside of an event procedure is said to have class-level scope. |
A. | true |
B. | false |
Answer» A. true |
14. |
Option Explicit requires you to declare every variable before its use. |
A. | true |
B. | false |
Answer» A. true |
15. |
The value returned by InputBox is a string. |
A. | true |
B. | false |
Answer» A. true |
16. |
What is the correct statement when declaring and assigning the value of 100 to an Integer variable called numPeople |
A. | dim numpeople = |
B. | dim numpeople = int(100) |
C. | numpeople = 100 |
D. | dim numpeople as integer = 100 |
Answer» D. dim numpeople as integer = 100 |
17. |
Which of the following arithmetic operations has the highest level of precedence? |
A. | + – |
B. | * / |
C. | ^ exponentiation |
D. | ( ) |
Answer» C. ^ exponentiation |
18. |
What value will be assigned to the numeric variable x when the following statement is executed? x = 2 + 3 * 4 |
A. | 20 |
B. | 14 |
C. | 92 |
D. | 234 |
Answer» B. 14 |
19. |
Which of the following is a valid name for a variable? |
A. | two_one |
B. | 2one |
C. | two one |
D. | two.one |
Answer» A. two_one |
20. |
Keywords in Visual Basic are words that |
A. | should be used when naming variables. |
B. | are used to name controls, such as textbox1, command2, etc. |
C. | have special meaning and should not be used when naming variables. |
D. | are used as prefixes for control names (such as txt, btn, lbl, and lst). |
Answer» C. have special meaning and should not be used when naming variables. |
21. |
To continue a long statement on another line, use: |
A. | an underscore character. |
B. | an ampersand character. |
C. | ctrl + enter. |
D. | a space followed by an underscore character. |
Answer» A. an underscore character. |
22. |
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 |
Answer» A. messagebox.show(“hi there”, “hi”) |
23. |
What will be the output of the following statement? txtBox.Text = FormatCurrency(1234.567) |
A. | $1234.567 |
B. | 1,234.57 |
C. | $1234.57 |
D. | $1,234.57 |
Answer» D. $1,234.57 |
24. |
The following lines of code are correct. If age >= 13 And < 20 Then txtOutput.Text = “You are a teenager.” End If |
A. | true |
B. | false |
Answer» B. false |
25. |
Given that x = 7, y = 2, and z = 4, the following If block will display “TRUE”. If (x > y) Or (y > z) Then txtBox.Text = “TRUE” End If |
A. | true |
B. | false |
Answer» A. true |
26. |
Asc(“A”) is 65. What is Asc(“C”)? |
A. | 66 |
B. | 67 |
C. | 68 |
D. | “c” |
Answer» B. 67 |
27. |
Asc(“A”) is 65. What is displayed by txtBox.Text = Chr(65) & “BC”? |
A. | abc |
B. | a bc |
C. | 656667 |
D. | not enough information is available. |
Answer» A. abc |
28. |
Which of the following expressions has as its value the words “Hello World? surrounded by quotation marks? |
A. | “hello world” |
B. | chr(34) & “hello world” |
C. | chr(34) & hello world & chr(34) |
D. | chr(34) & “hello world” & chr(34) |
Answer» A. “hello world” |
29. |
Which of the following is true? |
A. | “cat” = “cat” |
B. | “cat” < “cat” |
C. | “cat” > “cat” |
D. | relational operators are only valid for numeric values. |
Answer» B. “cat” < “cat” |
30. |
Which of the following is a valid Visual Basic conditional statement? |
A. | 2 < n < 5 |
B. | 2 < n or < 5 |
C. | 2 < n or 5 |
D. | (2 < n) or (n < 5) |
Answer» D. (2 < n) or (n < 5) |
31. |
The three main logical operators are ________, _________, and ________. |
A. | and, or, not |
B. | and, not, if |
C. | or, not, if |
D. | false, and, true |
Answer» A. and, or, not |
32. |
Which value for x would make the following condition true: x >= 5 |
A. | x is equal to 7 |
B. | x is equal to 5 |
C. | x is equal to 5.001 |
D. | all of the above |
Answer» D. all of the above |
33. |
Which value for x would make the following condition true: Not (x >= 5) |
A. | x is equal to 7 |
B. | x is equal to 4 |
C. | x is equal to 5.001 |
D. | x is equal to 5.001 |
Answer» B. x is equal to 4 |
34. |
Which value for x would make the following condition true: (x >= 5) And (x <= 6) |
A. | x is equal to 7 |
B. | x is equal to 5 |
C. | x is equal to 5.001 |
Answer» C. x is equal to 5.001 |
35. |
Constructs in which an If block is contained inside another If block are called: |
A. | multi-if blocks |
B. | nested if blocks |
C. | sequential if blocks |
D. | none of the above |
Answer» B. nested if blocks |
36. |
One may use an If block within a Select Case block. |
A. | true |
B. | false |
Answer» A. true |
37. |
One may use a Select Case block within an If block. |
A. | true |
B. | false |
Answer» A. true |
38. |
Select Case choices are determined by the value of an expression called a selector. |
A. | true |
B. | false |
Answer» A. true |
39. |
Items in the value list must evaluate to a literal of the same type as the selector |
A. | true |
B. | false |
Answer» A. true |
40. |
A single Case statement can contain multiple values. |
A. | true |
B. | false |
Answer» A. true |
41. |
You can specify a range of values in a Case clause by using the To keyword. |
A. | true |
B. | false |
Answer» A. true |
42. |
A variable declared inside a Select Case block cannot be referred to by code outside of the block. |
A. | true |
B. | false |
Answer» A. true |
43. |
Suppose that the selector in a Select Case block is the string variable myVar. Which of the following is NOT a valid Case clause? |
A. | case “adams” |
B. | case “739” |
C. | case (myvar.substring(0, 1) |
D. | case myvar.length |
Answer» D. case myvar.length |
44. |
Different items appearing in the same value list of a Select Case block must be separated by a ____________. |
A. | semi colon |
B. | comma |
C. | colon |
D. | pair of quotation marks |
Answer» B. comma |
45. |
Which Case clause will be true whenever the value of the selector in a Select Case block is between 1 and 5 or is 8? |
A. | case 1 to 8 |
B. | case 1 to 5, 8 |
C. | case 1 to 8, 5 |
D. | case 1 to 5; 8 |
Answer» B. case 1 to 5, 8 |
46. |
Which Case clause will be true whenever the value of the selector in a Select Case block is greater than or equal to 7? |
A. | case is >7 |
B. | case is = 8 |
C. | case is >= 7 |
D. | case is <= 8 |
Answer» C. case is >= 7 |
47. |
What type of items are valid for use in the value list of a Case clause? |
A. | literals |
B. | variables |
C. | expressions |
D. | all of the above |
Answer» D. all of the above |
48. |
What happens to a variable declared locally inside a Sub procedure after the procedure terminates? |
A. | it maintains its value even after the end sub statement executes. |
B. | it ceases to exist after the end sub statement executes. |
C. | it loses its value temporarily after the end sub statement executes, but regains that value upon re-entry to the sub procedure. |
D. | it is reset to its default value. |
Answer» B. it ceases to exist after the end sub statement executes. |
49. |
Suppose a variable is passed by reference to a parameter of a Sub procedure, and the parameter has its value changed inside the Sub procedure. What will the value of the variable be after the Sub procedure has executed? |
A. | it will have the newly modified value from inside the sub procedure. |
B. | its value can?t be determined without more information. |
C. | it will retain the value it had before the call to the sub procedure |
D. | none of the above. |
Answer» A. it will have the newly modified value from inside the sub procedure. |
50. |
Suppose a variable is passed by value to a parameter of a Sub procedure, and the parameter has its value changed inside the Sub procedure. What will the value of the variable be after the Sub procedure has executed? |
A. | it will have the newly modified value from inside the sub procedure. |
B. | its value can?t be determined without more information |
C. | it will retain the value it had before the call to the sub procedure |
D. | none of the above. |
Answer» C. it will retain the value it had before the call to the sub procedure |
Done Studing? Take A Test.
Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.