1.
(a)Explain the following: i. GUI ii. Toolbox Window iii. Solution Explorer [6 marks]
(b)Explain how to change the text property of a Label both during design and run time. [3 marks]
(c)What is the difference between Me.Close() and Me.Hide()? [3 marks]
(d)Explain three ways in which a control can be added to a form. [3 marks]
2.
(a)Draw the GUI of a simple calculator. [3 marks]
(b)Write the code that will perform the following tasks from (a): [9 marks]
i. Display 1 on the calculator textbox when the button with text property "1" is pressed.
ii. Clear the screen when the "C" button is pressed.
iii. Display the final result when the "=" sign button is pressed.
(c)Describe one method of converting a string to a number in Visual Basic. [3 marks]
3.
(a)Describe two ways to add items to a ListBox. [3 marks]
(b)Write a program that will display a list of the following characters in a ListBox {Mario, Luigi, Peach, Toad}. Provide a textbox that allows the user to insert a new character when the button Add is clicked. Write the program code, and populate the listbox at run time. [9 marks]
(c)Sketch the GUI of the application in (b). [3 marks]
4.
(a)Using any selection structure, write the portion of a program that will display a grade given the score: A – 100 to 70, B – 65 to 69, C – 60 to 64, D – 50 to 59, E – 40 to 49, F – 0 to 39. Also display to the user if there is an invalid entry for the score (use a Message Box for the error message). [10 marks]
(b)Sketch the program. [2 marks]
(c)Describe two if statements. [3 marks]
5.
(a)Correct the following code: [4 marks]
If = operation = "+" Then
total = value1 + value2;
ElseIf operation =/ "-" Then
total = value1 - value2
ElseIf operation // "*" Then
total = value1 * value2
ElseIf operation = "/" Then;
total = value1 / value1;
End If
(b)Write a program that takes in the user's Name, Level, Department, State, and Course. The user is to enter only his name. Other inputs are options for him/her to select. (Hint: use ListBox, ComboBox, CheckBox, and RadioButton for the option selection.) The program should display the following message in any display control of your choice: "My Name is Name I study course in the department of Department I live in state". Populate the listbox and combobox at run time. [9 marks]
(c)Draw the GUI of the program. [2 marks]
6.
(a)Write a program that will display a list of items in a listbox and add an item to an empty listbox when a user clicks on an item in the first listbox. [5 marks]
(b)List and explain three repetition structures in Visual Basic. [4 marks]
(c)Write a Visual Basic function that will find the maximum of two numbers and return the maximum value. [6 marks]

