Professional Documents
Culture Documents
AIS155 TEST1 Dec 22 - Q
AIS155 TEST1 Dec 22 - Q
LECTURER : ……………………………………………………..
INSTRUCTIONS TO CANDIDATES
1. This question paper consists of THREE (3) parts : PART A (20 Questions)
PART B ( 4 Questions)
PART C ( 1 Question)
Total marks 50
A. The Toolbox
B. The Project Window
C. The Properties Window
D. The Form Window
A. user interface.
B. algorithm.
C. specification.
D. code.
A. control
B. property
C. event
D. method
4. A statement that can execute property in Visual Basic but produce the wrong result is
__________.
A. Logic error
B. Compile error
C. Syntax error
D. Run-time error
5. Which of the following control is used to perform an immediate action when it is clicked
by user?
A. Label
B. Text Box
C. Form
D. Button
6. Suppose in the very early stages of the problem-solving process, your supervisor wants
you to show her the relationships between the various processes that will be needed to
solve the problem. The best way to do this would be to use __________.
A. a top-down chart
B. a sample program
C. a flowchart
D. an algorithm
A. Integer
B. Boolean
C. Currency
D. Decimal
A. btnDisplay.Caption = “Hello”
B. lblGreeting.Caption = “Hello”
C. lblGreeting.Print = “Hello”
D. lblGreeting.Text = “Hello”
9. Which of the objects is used to display information that you do not want the user to
change.
A. Label
B. Button
C. Text Box
D. Form
10. __________ is used for project documentation only. The purpose is to make the project
more readable and understandable by the people who read it.
A. Assignment statement
B. Remark statement
C. End statement
D. Label
11. Which of the following statement will return the insertion point to a textbox called
txtName?
A. txtName.SetFocus
B. txtName.SetFucus=True
C. txtName.Focus()
D. txtName.Text = Focus()
A. Caption
B. Text
C. Visible
D. Frame
14. Given X = 3 and Y = 2, what value will be assigned to Z when the following statement is
executed?
Z = X+Y^2+X*Y
A. 13
B. 31
C. 45
D. 56
15. Which of the following symbols is used to the string concatenation operator?
A. &
B. @
C. #
D. $
17. Which of the following VB codes will center the text in an object named txtBox?
A. txtBox.Text = TextAlign.Center
B. txtBox.TextAlign = HorizontalAlignment.Centre
C. txtBox.TextAlign = HorizontalAlignment.Center
D. txtBox.TextAlign = HorizontalAlignment.Middle
18. In order to make a picture expand to fill an image control, you must
A. 1,234
B. 1234
C. 1234.00
D. $1,234.00
QUESTION 1
QUESTION 2
The net pay for an employee is calculated after taking the deductions of 15 % for income tax and
RM75.00 for health insurance from the gross amount. Draw a flowchart that prompts the user to
enter the gross amount. Then, calculate and print the net pay for an employee.
(5 marks)
QUESTION 3
Write a Visual Basic statement to carry out the task below:
i. Clear the contents of txtProgram
ii. Give the focus to txtProgram
iii. Set the background colour of txtProgram to blue
iv. Display “AIS155: Business Computer Programming” in lblMessage
v. Format the number of 21% in lblPassRate
(5 marks)
PART C
QUESTION 1
ABC Enterprise developed a program for the calculation of depreciation. The user needs to fill in
the details about year, name of the asset, cost, salvage value and useful life. Lastly, the result will
show the year, depreciation charge for each asset and total depreciation charge for the year as
shown in object's label as per figure 1. Depreciation is calculated by simply dividing the cost of an
asset, less its salvage value, by the useful life of the asset.
Figure 1
Required:
Based on the user interface given in Figure 1, write a complete Visual Basic program code for
all command buttons.
(10 Marks)