Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

CONFIDENTIAL AC/ TEST 1/ DEC 2022/AIS155

UNIVERSITI TEKNOLOGI MARA


TEST 1

COURSE : BUSINESS COMPUTER PROGRAMMING

COURSE CODE : AIS155

DATE : 14 DECEMBER 2022

TIME : 1 HOUR 30 MINUTES

STUDENT NAME : ……………………………………………………...

STUDENT ID NO. : ……………..............GROUP : ……………......

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)

2. Answer ALL questions from all three parts:

i) PART A in Objective Answer Sheet.


ii) PART B and PART C in the space provided in this Question Paper.

Question Full Marks Your Marks


Part A 20
Part B – Q1 5
– Q2 5
– Q3 5
Part C – Q1 15

Total marks 50

DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO


This question paper consists of 7 printed pages

© Hak Cipta Universiti Teknologi MARA CONFIDENTIAL


2

PART A (20 MARKS)


This part consists of 20 multiple-choice questions.
1. Assume that you want to add a control to a form, in which window in the Visual Basic
environment would you get a command button?

A. The Toolbox
B. The Project Window
C. The Properties Window
D. The Form Window

2. A step-by-step solution for a problem solving or performing is called a/an

A. user interface.
B. algorithm.
C. specification.
D. code.

3. A BackColor is an example of __________.

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

© HakCiptaUniversitiTeknologi MARA CONFIDENTIAL


3

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

7. Which of the following is INVALID data type?

A. Integer
B. Boolean
C. Currency
D. Decimal

8. To make a label named lblGreeting produce a word “Hello” by pressing a button


named btnDisplay, what command would you use?

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

© HakCiptaUniversitiTeknologi MARA CONFIDENTIAL


4

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()

12. The three steps process involved in developing VB projects are:

A. planning the project, writing code, and debugging.


B. planning the project, create the interface and write code.
C. create the interface, write code, and execute the program.
D. create the interface, set the properties, and write code.

13. What is the default property for a textbox control?

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. $

© HakCiptaUniversitiTeknologi MARA CONFIDENTIAL


5

16. What is the effect of the statement picFlower.Visible = False?

A. It will cause picFlower to blink.


B. It will make picFlower somewhat “grayed out” and non-responsive to clicking
C. It will make picFlower invisible
D. It is not a valid Visual Basic command.

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. set the Visible property to True.


B. set the Stretch property to True.
C. set the Visible property to False.
D. set the Stretch property to False.

19. The Parse function is used to __________.

A. convert data in a textbox to a numeric value


B. properly aligns decimal positions in a numeric value
C. add a dollar sign ($) to improve the way the output looks
D. stops execution of a project

20. What will be the output of the following statement?


lblTotalQuantity.Text = decTotalQuantity.ToString (“F0”)

A. 1,234
B. 1234
C. 1234.00
D. $1,234.00

© HakCiptaUniversitiTeknologi MARA CONFIDENTIAL


6

PART B (20 MARKS)


Answer ALL questions.

QUESTION 1

a) Draw TWO (2) symbols used to create a flowchart.


(2 marks)

b) Identify THREE (3) steps involved in planning a Visual Basic Project.


(3 marks)
(Total: 5 marks)

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)

© HakCiptaUniversitiTeknologi MARA CONFIDENTIAL


7

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)

END OF QUESTION PAPER

© HakCiptaUniversitiTeknologi MARA CONFIDENTIAL

You might also like