Visual Basic Programming Language and Applications (CSCT3108)
Computer Science - COS
Semester: First Semester
Level: 300
Year: 2019
Page 1 of 2
REPUBLIC OF CAMEROON THE UNIVERSITY OF BAMENDA
Peace – Work – Fatherland P.O. BOX 39 Bambili
FIRST SEMESTER EXAMINATION
SCHOOL: HTTTC DEPARTMENT: Computer Science OPTION: ICT
COURSE CODE: CSCT3108 COURSE TITLE: Visual Basic programming Language
and applications
LECTURER: Mr. DEMANOU YMELE CREDIT VALUE: 3
DATE: 13/03/2019 TIME: 1h30 START: 12:00PM END: 1:30PM
Instructions: Answer all the questions
Exercise I (MCQs 10 marks)
1. You use the ____ method to add items to a list box
A) AddList B) Item C) AddItems D) Add
2. Dim count As Integer = 2
Do
MessageBox.Show(“VB.NET”)
count = count + 2
Loop While count > 10
How many times will the MessageBox.Show method in the code above be processed?
A) 1 B) 4 C) 5 D) 10
3. Dim sVariable as String = “Hello World”
sOutput = sVariable.Substring(1,3)
What is the content of sOutput?
A) llo B) Hel C) ell D) None of above
4. Dim IntArray(5) As Integer
How many elements in IntArray?
A) 4 B) 5 C) 6 D) None of above
5. Dim num() as Integer ={1, 2, 3, 4, 5,6,7,8}
Which of the following value stored in the num(5).
A) 4 B) 5 C) 6 D) None of above
www.schoolfaqs.net
Page 2 of 2
Exercise II (30 marks)
You need to generate an application named as “E-soft” to calculate ENEO bill. It takes the current index and the
previous index, then deduces the bill based on the following rule: If the consumption is more than 100kwh then, a
kilowatt will cost 70 FCA, otherwise, it will cost 50FCA – Example given on figure 1.
Using the variables names on the figure 1.
1. Write an instruction to compute the consumption
2. Give a code that calculates the bill
3. Provide an instruction to display the bill in a dialog box
4. Using instructions in the previous questions, fill the code
of « okBtn » handler
PrivateSubokBtn_Click(sender AsObject,_
eAsEventArgs) HandlesokBtn.Click
. . .
EndSub
Figure 1: E-Soft
Exercise III (30 marks)
1. Create a structure Book that has the following fields: title (String), author(String), year(Number)
2. Declare and array B that can store 100books.
3. Write a function that inserts a book at position pos in the array B using the following prototype:
Function register(ByValbookAsBook, ByValposAsInteger) AsInteger
4. The following application records books and display them on a list as shown below
5. Provide instructions for « recordBtn »handler
consLabel
billLabel
okBtn
previousIndex
currentIndex
bookListView
recordBtn
year
title
author
www.schoolfaqs.net