PROGRAMMING WITH VISUAL BASIC END OF SEMESTER TWO EXAMINATION 2014


END OF SEMESTER TWO EXAMINATION 2014

DIPLOMA IN COMPUTING AND INFORMATION TECHNOLOGY

(NTA LEVEL 5) EXAMINATIONS

CIT 05207- PROGRAMMING WITH VISUAL BASIC

 

TIME: 3 HOURS                                                                   DATE: 8/12/2014

 


Instructions

  1. This examination consists of sections A, B and C with six questions
  2. Answer all questions
  3. Marks for each question are indicated at the end of it.
  4. Do not write anything on the Question paper.
  5. Do not use mobile phone in the examination room.

 

SECTION A: (10 marks)

 

Question 1: multiple choice

 

      i.        Which function displays a pop-up window? (01 mark)

a.    MsgBox

b.     InputBox

c.    TextBox

d.    Both a and b.

e.    All of the above.

     ii.        Which selection process is an example of multiple branches from a single expression? (01 mark)

a.    If…Then

b.    Select Case

c.    For……Next

d.    Do….Loop

e.    All of the above

    iii.        Which do…Loop statement should be used to process test scores where a test score over 100 is a signal to stop the processing? (01 mark)

a.    Do While Score > 100

b.    Do Until Score > 100

c.    Loop While Score > 100

d.    Loop Until Score > 100

e.    All of the above are valid for this situation.

   iv.        The advantage of For…Next loops over Do…Loops is that they are  (01 mark)

a.    easier to read and maintain

b.    Good for working with arrays.

c.    Less prone to being infinite loops.

d.    All of the above.

 

    v.        In the For…Next statement the default value for the Step is:

a.    -1

b.    0

c.    1

d.    2

e.      There is no default for the step value

 

   vi.        The scope of a variable refers to:   (01 mark)

a.    The length of the variable.

b.    The name of the variable.

c.    The accessibility of the variable.

d.    The data type of the variable.

e.    The lifetime of the variable.

 

  vii.        For which task does the IDE provide multiple ways to accomplish the task?  (01 mark)

a.    Putting a control on the form

b.    Running the program

c.    Activating the property window for a control

d.    Both a and b.

e.    All of the above.

 

 viii.        Which are the standard prefixes for the Button and Combo box controls respectively? (01 mark)

a.    btn and chb

b.    btn and cbo

c.    bto and chb

d.    bto and cbo

e.    cmd and cbo

 

    ix.        The Boolean data type: (01 mark)

a.    Is unsigned.

b.    Has two states.

c.    Is displayed by the program as yes or no.

d.    Both a and b.

e.    All of the above.

 

     x.        The name of a constant: (01 mark)

a.    Must both begin with a letter and be all upper case.

b.    Does not have to begin with a letter but must be all upper case.

c.    Must begin with a letter but can be upper or lower case.

d.    Does not have to begin with a letter and be either upper or lower case.

e.    None of the above

 

                                        

SECTION B: (25 Marks)

Question 2:

 

Write the code that will make a menu popup from a Command Button? (10 marks)

 

 

Question 3:

                      i.        Mention Six windows appear when you start Visual Basic. (6 marks)

                   ii.        What is the difference between a function and a sub (method)? (2 marks)

                    iii.        What is Control Statements? And mention two example of control statement. (2 marks)

Question 4:

    1. What  is the difference between list box and combo box (2 marks)
    2. Mention the use of the following event and method? (3 marks)       

                                          i.    SetFocus ii. AddItem iii. Scroll

 

SECTION C: (25 Marks)

Question 6:

 

i.              Define the following terms  (5 marks)

a)    Variable

b)    Event procedure

c)    General Procedure

d)    Module

e)    Properties

 

ii.        Mention three primary steps involved in building a Visual Basic application.        (3 marks)

iii.         What is the difference between Image and Picture box controls? (2  marks)

Share:

No comments:

Post a Comment

Popular Posts

Pages