Uploaded by Thembani Thembani

ICT2611 Extra MultipleChoice 2017

advertisement
1.1 Alcon Toys manufactures several versions of a basic doll. Assume that the basic doll
is called Model A and the versions are called B, C, and D. In the context of OOP, the
Model A doll is called ______ class.
a. base
b. inherited
c. derived, base
d. exposed, hidden
e. inherited, derived
1.2 Fun Toys manufactures several versions of a basic doll, assume that the basic doll is
called Model A and the versions are called B, C and D. In the context of OOP, the Model
B, C and D are called ____ classes
a. Base
b. Derived
c. Encapsulated
d. Instance
1.3 In OOP, _________ refers to the fact that you can create one class from another class.
a. abstraction
b. combining
c. encapsulation
d. exposition
e. inheritance
1.4 The ______ provides most of the tools required to design a user interface.
a. Solution Explorer
b. Form designer window
c. Toolbox window
d. Properties window
e. Attributes window
1.5 The ______ provides all of the tools required to design a user interface.
a. Solution Explorer
b. Form designer window
c. Toolbox window
d. Properties window
e. Attributes window
1.6 The last step in planning an OOED application is to ____________
a. draw a sketch of the user interface.
b. identify the objects to which tasks will be assigned.
c. identify the tasks the application needs to perform.
d. identify the event you want to trigger an object into performing its assigned tasks.
e. plan the code.
1.7 You can use a ____________ control to process code at regular time intervals.
a. watch
b. counter
c. clock
d. timer
e. register
1.8 The programming process begins with a meeting between the programmer and the
client. Which of the following activities would be the fifth in the programming process?
a. Build the user interface.
b. Plan the application.
c. Assemble the documentation.
d. Code the application.
e. Test and debug the application.
1.9 Consider the expression 100/10*2>15-3 AndAlso 3*2^2<16+5. Which operation is
performed third?
a. +
b. /
c. *
d. ^
1.10
Consider the expression 3^2*2<16+5 AndAlso 100/10*2>15-3. Which operation is
performed first.
a. *
b. /
c. +
d. ^
1.11
The character ___ is used to assign an access key to a control.
a. *
b. @
c. &
d. $
e. #
1.12
If we need to use a logical condition to determine whether the AccountBalance is
not more than CreditLimit, which of the following is correct?
a. AccountBalance = CreditLimit
b. AccountBalance >= CreditLimit
c. AccountBalance <= CreditLimit
d. AccountBalance <> CreditLimit
e. AccountBalance + CreditLimit > 0
1.13
Select the correct statement. When designing a user form, it is recommended to:
a. place the buttons in a row along the top of the user form.
b. place the less commonly used buttons first.
c. limit the number of buttons to six per screen.
d. arrange information horizontally with the most important first.
e. group related information with appropriate shape, such as a rectangle.
1.14
If you do not provide a data type when declaring a variable, Visual Basic
automatically assigns a data type to the declared variable, which is ________.
a. Integer
b. String
c. Decimal
d. Object
e. Double
1.15
The ___________event occurs when a form is being read into the computer’s
internal memory.
a. click
b. load
c. double-click
d. close
e. keypress
1.16
Which of the following is the correct data type to use for a variable that will always
contain a whole number less than 90 000?
a. Short
b. Long
c. Decimal
d. Double
e. Integer
1.17
Which of the following is not one of the standard flowchart symbols?
a. Circle
b. Diamond
c. Parallelogram
d. Rectangle
e. Oval
1.18
A _____ variable can be used to share data between user forms in a project since
all the forms have access to it.
a. global
b. form-level
c. static
d. local
e. public
1.19
To
arrange
the
elements
in
an
array
in
ascending
order
the_____________method.
a. Array.Sort()
b. Array.Arrange()
c. Array.Ascending()
d. Array.Decending()
1.20
Assume that an array is loaded with the following information:
Dim sngCost () as Single = {45.09, 121.87, 35.16, 89.99}
What value is displayed with Debug.Writeline (sngCost (2))?
a. 35.16
b. 45.09
c. 80.99
d. 121.87
1.21
The VB instruction to change the value 121.87 to 21.87 is ________
a. sngCost(0) = 21.87
b. sngCost(1) = 21.87
c. sngCost(2) = 21.87
you
use
d. 2. sngCost(3) = 21.87
1.22
The __________ property determines the graphic to display in a picture box control.
a. image
b. display image
c. graphic
d. picture
1.23
When placing command buttons on a form, it is recommended to _________
a. place them in a row at the top right-corner, and most important first
b. place them in row at the bottom, at the most commonly used first
c. pace them in column and the less commonly used first
d. place them at the bottom left-corner with the most commonly used first
1.24
When placing command buttons on a form, it is a good idea to
a. place them all in a raw
b. place them on the diagonal
c. limit the number to eight
d. limit the caption to three characters
1.25
What is the most appropriate data type (that uses a minimum memory space) to use
for a whole number that is always less of equal to 50 000?
a. integer
b. short
c. byte
d. object
1.26
Visual Basic evaluates arithmetic expression based on the precedence number of
the operations in the expression unless the parentheses are used to force the order of
evaluation. Thus, the value of the expression 6/3-1+2*3 is _____
a. 10
b. 9
c. 7
d. 5
1.27
A ______variable is known only to the procedure in which it is declared.
a. form-level
b. current
c. local
d. public
1.28
When designing a user interface, the most important information should be placed
in the _____ of the screen
a. lower-left corner
b. lower-right corner
c. upper-left corner
d. upper-right corner
1.29
Which of the following is the appropriate data type to use for a variable that will
always contain a whole number less than 70 000?
a. integer
b. long
c. decimal
d. single
1.30
Choose the correct option. A(n) ____ is an instance of a class
a. 1 Method
b. Event
c. Object
d. Property
1.31
With a(n) ______, a program specifies the exact sequence of all properties
a. 1 Event -driven language
b. Formal language
c. Procedural language
d. Object-oriented language
1.32
Indicate which one of the following ways of clearing the textbox control is incorrect
or not appropriate at runtime
a. 1 Assign the blank string "" to the text property of the textbox
b. Assign the Empty String property of the object String (String Empty) to the text property of
the textbox
c. Call the clear method of the textbox (TextBoxName.Clear())
d. Call the reset property of the textbox (TexBoxName.Reset())
1.33
Select the incorrect statement
a. 1 What makes check boxes different from radio buttons is that, which check boxes only
one option of chosen at once whereas more than one radio button can be selected
b. Visual Basic allows programmers to download and install some class of controls that are
not readily available on the toolbox window. Example are the Line and Shape controls
c. To obtain help on a particular control, one may select the control on the Toolbox and press
the F1 key on the keyboard to display the help window
d. a groupbox control is a container for other controls that aims at making user forms easier
to understand
1.34
Consider the following sub procedure and select the wrong option:
Public class ExitForm
Private Sub ButtonExit_Click(ByVal sender As System Object, byVal e As System EvenArgs)
Handles ButtomExit Click
End the program
ButtomExit text = "Close"
End Sub
End Class
a. 1 The project includes a form named ExitForm
b. There is an object in the form named ButtomExit
c. The arguments of the sub procedure are generated by Visual Basic, there is no need to
change them
d. The procedure includes a comment to explain the purpose if the next instruction followed
by the instruction itself that closes the form and then end the program
1.35
Select the correct value displayed by the following sub procedure:
Private sub DisplayResult()
MessageBox Show (4+3*4/2-5)
End Sub
a. 1 5
b. 9
c. 0
d. -5
1.36
Select the correct statement
a. 1 Good programming practice dictates that programmers include executable instructions
in program code to document their project for clarity purposes
b. In Visual Basic Net, a sub procedure is certainly different from a sub routing because VB
has a statement for a subroutine which is not the same as a sub procedure
c. In a VB Net program code, an assignment statement operates from right to left the value
appearing on the right side of equal sign is assigned to the variable which appears on the
left side of the equal sign
d. An assignment statement may be used to assign a value to a variable as well as object
properties, when it is not a read only property
1.37
A _____ is an application that does not have a windows-based user interface
a. 1 Graphic program
b. Data-entry system
c. Game program
d. Microsoft word
e. None of the above
1.38
1.37 The following option is provided by the format menu to help manipulate the
controls in the user interface
a. 1 Align
b. Make same size
c. Center in form
d. All of the above
e. None of the above
1.39
The following is not explicitly a valid step in the creation process of an OOED
application:
a. Meet with the client
b. Build the user interface
c. Code the application
d. Use a TOE chart to record the application’s tasks, objects, and events.
e. None of the above
1.40
Visual Basic.net evaluates arithmetic expressions based on the precedence
members of the operators in the expression, thus what is the value of the expression
2*5+2*14/7-6?
a. 1 8
b. 38
c. 18
d. 50
e. 196
1.41
One of the following instruction(s) is not correct (may generate an error) choose the
incorrect one
a. Const P1 = 314
b. Const P1 As integer = 3
c. Const P1 As Double
P1 = 314
d. Dim BNumber as Byte = 255
e. None of the above is erroneous
1.42
Consider the following piece of Visual Basic Net code and choose the correct option
Dim count As Integer
Dim result As Double = 1
For count = 0 to 2
result = result*2
Next count
MessageBox.Show(result)
a. 1 The variable count takes successively the values 0,1,2 and the final result, which is 6 is
displayed on a Message Box
b. After executing the above sequence of instructions, the following calculation is performed
0*2+1*2+2*2 and the resulting value, which is 6 is displayed on a Message Box.
c. After executing the piece of code, the following calculations are performed 0*2 then 1*2
then 2*2 and the last result, which is 4 is displayed on a Message Box
d. After executing the piece of code, the variable count takes successively the values 0,1,2
and the result of the calculations, which is 0 (zero) is displayed on a Message Box
e. None of the above option is correct
1.43
In the expression 4*3+15/3-6 which of the operations is performed first?
a. 1 +
b. c. *
d. /
e. None of the above
1.44
A(n) ______ is an interaction of a user with an application
a. 1 Instruction
b. Procedure
c. Event
d. Function
e. All of the above
1.45
In the context of OOP, refers to the fact that a class contains all of the attributes
and behaviors that describe the object of the class created.
a. Inheritance
b. Blue print
c. Encapsulation
d. Abstraction
e. Combining
1.46
In the context of OOP, a ____ is a pattern used to create an object
a. 1 Blue print
b. Class
c. Behavior
d. Polymorphism
e. Model
1.47
Which of the following is the correct data type to use for a variable that will always
store a number between 50 and 100?
a. Decimal
b. Long
c. Integer
d. Byte
e. Short
1.48
A good practice in documenting a program code is .
a. To construct sentences with appropriate punctuation such as to make the code clear and
unambiguous
b. To edit the code using appropriate font and font size such as to render the program clear
and readable
c. Apply indentation of code.
d. To add meaningful comments to the code as reminders. *
e. None of the above
1.49
A good practice in documenting a program code is
a. To construct sentences with appropriate punctuation such as to make the code clear and
unambiguous
b. To edit the code using appropriate font and font size such as to render the program clear
and readable
c. To add meaningful comments to the code as reminders.
d. A and B but, not C
e. None of the above
1.50
The following option is provided by the format menu to help you manipulate
the
controls in the user interface.
a. Align
b. Make same size
c. Center in form
d. All of the above
e. None of the above
1.51
In
procedure-oriented approach
of
solving
programming problems, the
following is performed:
a. The programmer needs to identify the objects on which the task to be performed are based
b. The programmer identifies the tasks that will be performed
c. For each object selected, the code is written in step-by-step
d. All of the above
e. None of the above
1.52
Visual Basic.NET evaluates arithmetic expressions based on the precedence
numbers of the operators in the expression unless the parentheses are used to force
the order of evaluation. Thus the value of the expression 4*(3+12)/3-6 is.
a. 10
b. 8
c. –20
d. 14
e. None of the above
1.53
Which of the following assertion is not true about the static variable?
a. A static is not removed from the memory until the application ends.
b. A static variable is a global variable.
c. A static variable is local variable.
d. A static variable retains its value after the procedure in which it is declared ends.
e. None of the above.
1.54
Select the incorrect statement
a. Const Pi = 3.14
b. Const Pi As Integer = 3
c. Const Pi As Double Pi = 3.14
d. All of the above are incorrect.
e. None of the above is incorrect.
1.55
Select the correct statement
a. Const Pi As Double = 3.14
b. Const Pi As Integer = 3.14
c. Const Pi As Double Pi = 3.14
d. Const Pi = 3.14
e. Double Pi As Const = 3.14
1.56
Each of the following options defines a rule for naming a variable. Choose the
incorrect rule.
a. The name must begin with a letter.
b. The name must contain only letters, numbers, and the underscore character. No
punctuation characters or spaces are allowed in the name.
c. The name cannot contain more than 255 characters: the recommended maximum is 32.
d. The name cannot be reserved word such as Dim or Private.
e. An example of a variable is: 25IsMyAge
1.57
Each of the following options defines a rule for naming a variable. Choose the
incorrect rule.
a. The name can begin with letters and numbers.
b. The name must contain only letters, numbers, and the underscore character. No
punctuation characters or spaces are allowed in the name.
c. The name cannot be reserved word such as Dim or Private.
d. The name cannot contain more than 255 characters: the recommended maximum is 32.
e. All the rules are incorrect.
1.58
A ____ is a container that holds the entire GUI controls that make up your Visual
Basic Net Program
a. 1 Windows form
b. control group
c. Top-level group
d. Tool box
1.59
The Label control is used in a Visual Basic Net application to display this in a
window
a. 1 A piece of text
b. A pop up help box for other controls
c. The information contained in the title bar at the top of the window
d. None of the above
1.60
Which of the following statements is not true about user-defined functions?
a. 1 Functions have parameter lists just like general sub procedures
b. Variables declared inside the function are global to the entire module
c. Functions are not associated with any control (they handle no events)
d. Just like built-in functions, user-defined functions return a value to the caller
1.61
When using encapsulation how should data be shared with external code
a. 1 Events
b. Methods
c. Properties
d. Private variables
1.62
Methods declared with the following modifier are nor accessible outside a class
a. 1 Private
b. Protected
c. Friend
d. Global
1.63
Which is a type of procedure found in Visual Basic Net
a. 1 Event Handler
b. Function
c. Sub
d. All of the above
1.64
The analysis phase of software development involves
a. 1 Collecting the requirements about what the program will accomplish
b. Creating a detailed plan on how the program will accomplish the requirements
c. Writing the software with a program such as VB NET
d. Both 1 and 2
1.65
In event-driven programming an event is generated by:
a. the system
b. a user's action
c. the program itself
d. Both a and b
e. All of the above
1.66
Which of the following is a flaoting point data type?
a. Single
b. Byte
c. Short
d. Integer
e. Long
1.67
The proper opearator precedence, from first to last, is:
a. logical, comparison, and arithmentic
b. arithmentic, comparison, and logical
c. arithmentic, logical, and comparison
d. comparison, arithmentic, and logical
e. logical, arithmentic, and comparison
1.68
With A = False and B = True, which statement evaluates as True?
a. A AND A
b. A AND B
c. B AND A
d. B AND B
e. None are true
1.69
Which is true about the name and text property of a control?
a. They are the same when the control is first created
b. The text property changes to match any changes in the name property
c. The name property changes to match any change in the text property
d. They are never the same unless the programmer makes it that way
e. They are not allowed to be the same and an error will occur if they are
1.70
A GUI
a. uses buttons, menus, amd icons
b. should be easy for a user to manipulate
c. stands for Graphic Use Interface
d. Both a and b
e. All of the above
1.71
What happens when a parameter is a procedure is declared ByVal?
a. Only arguments of numeric data types are allowed
b. A reference to the argument is sent to the procedure
c. A copy of the argument is sent to the procedure
d. Both a and b
e. All of the above
1.72
Which is true about objects?
a. Objects are used to create classes
b. Objects are analogous to blueprints
c. Objects combine actions and data
d. Both a and b
e. All of the above
1.73
The term instantiation refers to the creation of
a. a class from a blueprint
b. an object from a class
c. a method from an object
d. a property from a method
e. a blueprint from a property
1.74
Encapsulation makes is easier to
a. reuse and modify existing modules of code
b. write and read code by sharing method names
c. hide and protect data from external code
d. Both a and b
e. All of the above
1.75
Inheritance makes it easier to
a. reuse and modify existing modules of code
b. write and read code by sharing method names
c. hide and protect data from external code
d. Both a and b
e. All of the above
1.76
Which statement is true?
a. A base class inherits some of the properties of a derived class
b. A base class inherits all of the properties of a derived class
c. A derived class inherits some of the properties of a base class
d. A derived class inherits all of the properties of a base class
e. None of the above
1.77
Polymorphism makes it easier to
a. reuse and modify existing modules of code
b. write and read code by sharing method names
c. hide and protect data from external code
d. Both a and b
e. All of the above
1.78
What will be the content of the variable x after the following statement is executed?
x = (9 + 7) / (4 * 2) + 2
a. 1
b. 2
c. 3
d. 4
e) None of the above
1.79
What will be the content of the variable x after the following statement is executed?
x = (32 + 16) / (3 * 2) + 2
a. 4
b. 8
c. 16
d. 10
1.80
Which one of the following is NOT one of the three basic types of statement
structures?
a. sequence
b. loops
c. decision
d. input/output
e. All of the above are NOT statement structure
1.81
Which type of procedure returns a value?
a. Sub-Procedure
b. Procedure
c. Function
d. ByVal
e. None of the above
1.82
Which statement about objects is true?
a. One object is used to create one class
b. One class is used to create one object
c. One object can create many classes
d. One class can create many objects
e. There is no relationship between objects and classes
1.83
Which property determines whether a control is displayed to the user?
a. Hide
b. Show
c. Visible
d. Enabled
e. Cursor
1.84
Which selection process is an example of multiple branches from a single
expression?
a. If Then
b. Select Case
c. Do Loop
d. For...Next
e. All of the above
1.85
Which Do Loop statement should be used to process test scores where a test score
over 100 is a signal to stop the processing?
a. Do While Score > 100
b. So Until Score > 100
c. Loop While Score > 100
d. Loop Until Score > 100
e. All of the above are valid for this situation
1.86
Which statement will send the value generate by a function procedure, called,
CalculateTax, back to the calling code?
a. Return Sales * 0.08
b. CalculateTax = Sales * 0.08
c. Return CalculateTax (Sales * 0.08)
d. Both a and b
e. All of the above
1.87
The second step in planning an OOED application is to
a. plan the code.
b. identify the objects to which tasks will be assigned.
c. identify the tasks the application needs to perform.
d. draw a sketch of the user interface.
e. identify the event you want to trigger an object into performing its assigned tasks.
1.88
If we need to use a logical condition to determine whether the AccountBalance is
more than CreditLimit, which of the following is correct?
a. AccountBalance = CreditLimit
b. AccountBalance + CreditLimit > 0
c. AccountBalance <= CreditLimit
d. AccountBalance <> CreditLimit
e. AccountBalance > CreditLimit
1.89
The loop programming construct is used for the following purposes.
a. It is a decision construct
b. It is a construct for repetition
c. It is a construct for repetition and decision
d. It is used for exception handling
1.90
The following is true about the programming Case statement and the If statement.
a. They are decision constructs
b. They are constructs for repetition
c. They are constructs for repetition and decision
d. They are used for exception handling
1.91
The following event occurs when a form is loaded into memory.
a. Click
b. Load
c. Keypress
d. Right click
1.92
Inheritance makes the following possible
a. Reuse existing code
b. Exception handling
c. Hide internal details of a class
d. All of the above
1.93
Encapsulation makes the following possible
a. Reuse existing code
b. Exception handling
c. Hide internal details of a class
d. All of the above
1.94
Passing a parameter to a program ByVal means the following
a. A copy of the variable is made for the procedure
b. A reference to the variable is made for the procedure
c. Only numeric parameters are allowed
d. None of the above
Download