Vous êtes sur la page 1sur 10

AC/APR 2011/AIS150

CONFIDENTIAL

UNIVERSITI TEKNOLOGI MARA


FINAL EXAMINATION

COURSE

BUSINESS COMPUTER PROGRAMMING

COURSE CODE

AIS150

EXAMINATION

APRIL 2011

TIME

3 HOURS

INSTRUCTIONS TO CANDIDATES
1.

This question paper consists of three (3) parts : PART A (20 Questions)
PART B (5 Questions)
PART C (2 Questions)

2.

Answer ALL questions from all three (3) parts :


i) Answer PART A in the Objective Answer Sheet.
ii) Answer PART B and C in the Answer Booklet. Start each answer on a new page.

3.

Do not bring any material into the examination room unless permission is given by the
invigilator.

4.

Please check to make sure that this examination pack consists of:
i)
ii)
iii)

the Question Paper


an Answer Booklet - provided by the Faculty
an Objective Answer Sheet - provided by the Faculty

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


This examination paper consists of 10 printed pages
Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL

AC/APR 2011/AIS150

PART A
This part consists of 20 multiple-choice questions. Choose the most suitable answer
and shade the corresponding alphabet representing the answer in the multiple choice
answer sheet provided.

1.

There are six (6) steps in the process of program development cycle. Which of the
following is the third (3rd) step?
A.
B.
C.
D.

2.

VB works with objects, properties and methods. Which of the following is a method?
A.
B.
C.
D.

3.

pseudo-code
flowchart
algorithm
image

Which of the following is a valid name for a variable?


A.
B.
C.
D.

5.

Print
Form
Color
Name

Which of the following would be the best for a pictorial representation of program
logic?
A.
B.
C.
D.

4.

Design the solution of the problems


Coding
Design the user interface
Test and debugging

Two_One
20ne
Two One
Two. One

Each class of control has a default property. The default property of a command button
is
.
A.
B.
C.
D.

Value
Caption
Visible
Text

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL
6.

7.

Which of the following statement are the advantages of using named constant in
Visual Basic project?
i)
ii)
iii)
iv)

very easy to give their name


modification is done only once to the constant declaration statement
changes is needed to every reference to it throughout the code
easier to read the code

A.
B.
C.
D.

i & ii
ii & iv
ii, iii & iv
i & iv

Which of the following is NOT a valid statement about the Val function?
A.
B.
C.
D.

8.

The Val function returns a value of 1 if it is used on an empty text box.


Val stands for value.
The Val function must be supplied with an argument.
The Val function is used to convert the value in a text box to a numeric value.

Suppose the variable MyName is declared in a Dim statement in two different Sub
procedures. Which statement is true?
A.
B.
C.
D.

9.

AC/APR 2011/AIS150

The program will malfunction when it is executed.


When the value of MyName is changed in one Sub procedure, it will also be
changed in the other Sub procedure.
The two variables will be local to their respective Sub procedures.
Visual Basic's smart editor will alert you that this is an error before the program is
executed.

Given A = 3 and B = 1, what value will be assigned to W when the following statement
is executed?
W=

A.
B.
C.
D.

(-A + 3 * 17)

(A + B)

(A -

B)

16
2
17
3

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL
10.

AC/APR 2011/AIS150

What will be the value of Z after this code is executed?


Dim X as integer
Dim Y as integer
X=3
Y=3
If X>=Y Then
Z=X+Y
Else
Z=Y-X
End If
picOut.Print Z
A.
B.
C.
D.

11.

Which of the following logical operator describe that either one condition must be true
for an entire condition to be true?
A.
B.
C.
D.

12.

Do Until
Do While
Loop Until
Loop While

The comparison of string variables begins from


A.
B.
C.
D.

14.

OR
AND
NOT
EQUAL

The pre test Do/loop that is tested for true to execute until it meets a false to stop is
called the
.
A.
B.
C.
D.

13.

3 .
9
6
0

top to bottom
left to right
right to left
all sides can do

What is the code that will print the current form on the printer?
A.
B.
C.
D.

Printform
Print
Formprint
Printscreen

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL

15.

an End statement.
an Assignment statement.
a Remark statement.
an event procedure.

What will happen to the Do Until ...Loops if the terminating condition is true the first
time it is tested?
A.
B.
C.
D.

19.

Press and hold the CTRL key and then press the S key.
Open the Run menu and choose Start.
Press the Start button on the toolbar.
Press F5.

If a line of code is not considered "executable", it must be


A.
B.
C.
D.

18.

run time error


logic error
compile error
operator error

Which of the following choices CANNOT be used to start running a project?


A.
B.
C.
D.

17.

AC/APR 2011 /AIS150

A project that halts during execution due to a misspelled name of an object or property,
was halted due to a(n)
.
A.
B.
C.
D.

16.

The
The
The
The

loop will
loop will
loop will
loop will

be executed only once.


be executed many times.
never be executed.
be executed at least twice.

What is the value of intlndex after the loop below is executed?

Dim intlndex as Integer


For intlndex = 4 to 1
'Statements in loop
Next intlndex

A.
B.
C.
D.

-1
0
1
4

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL

20.

AC/APR 2011/AIS150

P r i v a t e Sub Commandl_Click()
For intNumber =12 To 10 Step - 2
p i c O u t . P r i n t intNumber
Next intNumber
End Sub
How many times will the picOut.Print intNumber instruction be processed?
A.
B.
C.
D.

1
2
3
4
(1 Vz marks each)
(Total: 30 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL

AC/APR 2011/AIS150

PARTB
This part consists of FIVE (5) questions. Answer ALL questions and write your
answers in the answer booklet.
QUESTION 1
Describe the contents of LabeM after the Commandl button is pressed.
a)

Private Sub Command 1_Click()


Label 1. Font. Bold=True
Label 1.Caption = "Good Luck"
End Sub
(2 marks)

b)

Private Sub Command 1_Click()


LabeM .Caption = "My First Quiz"
Label! Visible = False
End Sub
(2 marks)

c)

Private Sub Command 1_Click()


LabeM.Caption = "Good Luck"
LabeM.Caption = "Hello"
End Sub
(2 marks)
(Total: 6 marks)

QUESTION 2
Based on the following screen design;
PURCHASE INFORMATION
Date:

JTV7/2010

Price Of Product:

JRM300.00

Sales Tax Rate*.


Total Sales:

a)

Write the declaration statements for each of the variable on the screen design.
(4 marks)

b)

Write the formatted output display for each of the variable on the screen design.
(4 marks)
(Total: 8 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL

AC/APR 2011/AIS150

QUESTION 3
Display the result for the following if a= 3, b=4 and c=5
a)

x = ( c - a ) b - a + ba

p i c O u t . P r i n t " Answer = " & x


(2 marks)
b)

x = a*b + c/2

p i c O u t . P r i n t " Answer = " & x


(2 marks)
(Total: 4 marks)
QUESTION 4
a)

What is the purpose of declaring variables and constant?

b)

Define named and intrinsic constant.

c)

Give an example of a declaration statement for varible and named constant.

(2 marks)
(4 marks)
(4 marks)
(Total: 10 marks)

QUESTION 5
Write a VB program segment for each of the following problems:

a)

Find the sum of odd numbers from 1 to 20 by using do - loop until and display it in the
picture box.
(4 marks)

b)

Find the square numbers from 1 to 20 by using do - loop while and display it in the
picture box.
(4 marks)

c)

Find the sum of all numbers from 1 to 20 by using for., next and display it in the picture
box.
(4 marks)
(Total: 12 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

AC/APR 2011/AIS150

CONFIDENTIAL

PARTC
This part consists of TWO (2) questions. Answer ALL questions and write your
answers in the answer booklet.
QUESTION 1
Write a VB program using IF statement that would perform the calculation and will display an
output shown as below.
PEE RAM LEE CINEMA TICKETING SYSTEM

PEE RAM LEE CINEMA TICKETING


Snack & Beverage

Movie

Tiga Abdul [RM8.00]

! PopCom(RM4.00)

DoReMifRMG.OO)

h> Pringtes (RM5.00)

C BujangLapok(RM7.00)

TOTAL CHARGE:

Soft Drink (RM2.00)

CALCULATE
EXIT

(13 marks)

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

CONFIDENTIAL

10

AC/APR 2011/AIS150

QUESTION 2
Below is a table that provides the terms used by the National Weather Center to describe the
degree of cloudiness.
a)

You are required to sketch an interface where user will enter a percentage of cloud
cover and press a button to display the description. Include also Clear and Exit
command.
(4 marks)

b)

Write all coding for the command buttons. Using Select Case statement, write a
program that request the percentage of cloud as input and then displays the
appropriate descriptor. Prompt a Message Box for an invalid input.
(13 marks)
Percentage of cloud cover
<0
0-30
31-70
71-99
100
>100

Descriptor
Prompt Invalid Message
Clear
Partly cloudy
Cloudy
Overcast
Prompt Invalid Message
(Total: 17 marks)

END OF QUESTION PAPER

Hak Cipta Universiti Teknologi MARA

CONFIDENTIAL

Vous aimerez peut-être aussi