0% found this document useful (0 votes)
49 views7 pages

Visual Basic Level 200 by Akiola

This document outlines the examination details for the BSc. Computer Science program at the University for Development Studies, specifically for the course CSC 205: Visual Programming with Visual Basic.NET. It includes instructions for the exam, such as answering all questions in Section A and three questions from Section B, along with guidelines for completing the answer booklet. The document also contains a series of multiple-choice questions related to Visual Basic programming concepts.

Uploaded by

abdulbaasit814
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views7 pages

Visual Basic Level 200 by Akiola

This document outlines the examination details for the BSc. Computer Science program at the University for Development Studies, specifically for the course CSC 205: Visual Programming with Visual Basic.NET. It includes instructions for the exam, such as answering all questions in Section A and three questions from Section B, along with guidelines for completing the answer booklet. The document also contains a series of multiple-choice questions related to Visual Basic programming concepts.

Uploaded by

abdulbaasit814
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

INDEX NUMBER.. .................... .. .............. .............. .............. .............. ..... .

UNIVERSITY FOR DEVELOP MENT STUDIES


FACULTY OF PHYSICAL SCIENCES
DEPARTMENT OF COMPUTE R SCIENCE
BSC. COMPUTER SCIENCE, LEVEL 200
2023/2024 END-OF-FIRST TRIMEST ER EXAMINATIONS
CSC 205: VISUAL PROGRAM1"'1ING WITH VISUAL BASIC.NET

Date of examination: 27th March, 2024 Time Allowed: .. . 3hrs .... ....
INSTRUCTIONS:
1. Answer ALL Questions in Section A and THREE (3) questions in Section B.
ii. Answer all questions into the ANSWER BOOKLET provided.
111. Do all rough work on the ANSWER BOOKLET where necessary.
1v. Write your INDEX NUMBER clearly on each page of the paper.
v. Make sure you have signed the attendance sheet before leaving the exams room.

S. Alhassan, Page 1 of 7
S E C T IO N A
INSTRUCTIO (40 M A R K S }
N: In this sectio
appropriate answ n, there are 40 h o se th e m o st
er from the op multiple choic
tions lettered A e questions, P
to D. All ques 1 ;: e ~ k s -
tions ca rr y e q
l. _ _is a data type th rn
declare a text at ca n be u sed to 7. Option button ca n be gro u p e d in a
o f maximum l s
characters. O million con tro l.
- -
A. tex-
A. Long tbox
B. Date B . label
C. Double C. panel
D. String. D. co m
2. What is th 8 Which b o b o x • te s
e result o f th · st at em en t an
e te rn u n a &.
expression: b = following application that · on lY o n e .Lonn•,.,
13 > 12 A contains
5. n d 6 < A. Me.CloseO
A. True B . Me.DoneO
B. False C. Me.Finish()
C. Both A. and D. Me.Stop()
B. 9. In visual bas •
D. None ic _ __ is the extension to
Which o f the represent project
following statem file.
equivalent to th ents is A.. fnn
e statement
iC o u n t = iC 8 .. els
o u n t + 8?
A. iCount =+ 8 C ..tx t
B. iCount += 8 D.. vbp
C. 8 += iCount 10. Which prop
erty determine
D. 8 =+ iCount o f the text insid s th e p o si ti o n
e a label c o n
tr o l?
A. Align
Which o f the fo B. Alignment
llo
evaluate to True wing If clauses will C. AlignText
when the Bonu
box is selected? s check D. TextAlign
A. If chkBonus. 11. The _ _ _
Check = True T control used to
B. If chkBonus. hen to the fonn. in se rt imaoe
Checked Then
C. If chkBonus.C A. textbox
0
hecked = True T
D. Both b and C hen B. panel
.
f ariables are nam
ed storage locati C. shape
nemory, ~ e val ons in D. picture.
hange dunng proue o f which does not
gram ........................ 12. ~o::: many
"· design • .. times will the
H 1 appear strino •
• modification •
the below codin the lblM c:, li
1 debug
•. D. . es
·
is e
sg control wtehra
en
l
execution • x
im in tC o u n t ecuted?
Do W h il e . A •
hlch ~ d o w list s Inte
luded 1n a soluti s the projects and files
in tC o u nt > g 4
er
on? lb lM lb lM s g T
Object s g .T . ext
>roject C o n tr o lC he x t -
. &
•ropert1e•
s in tC
a r s .N e w L in " H i" &
Loop o u n t +- 1 e
olution Explore -
r A. zero
B. one
Nl1EX NUMBER: ................................................................................... .

C. four C. function
D. five D. ByRef
13. Which of the following methods is used 20. Which property is used to specify a
to add items to a list box? combo box's style?
A. Add A. ComboBoxStyle
B. AddList B. DropDownStyle
C. Iten1 C. DropStyle
D. ItemAdd D. Style
21. Which is not a proper looping structure?
14. The _ _ keyword refers to current A. Do Until
form in Vb.Net project. B. Loop Until
A. this C. For Next
B. current D. For each Next
C.me 22. Which of the following assigns the
D. new number of characters in the strAddress
15. If a radio button is selected, its variable to the intNum variable?
_ _ _ _ _ _ property contains the A. intNum = strAddress.Length
Boolean value True. B. intNum = strAddress.LengthOf
A. Checked C. intNum = Length(strAddress)
B.On D. intNum = LengthOf(strAddress)
C. Selected 23. Which of the following methods can be
D. Selection used to determine whether the strRate
16. What are the items that appear within variable contains the percent sign?
parentheses in a procedure header called? A. blnResult = strRate.Contains("¾")
A. arguments B. intResult = strRate.IndexOf("¾")
B. parameters C. intResult = strRate.IndexOf("¾", 0)
C. passers D. All of the above.
D. None of the above. 24. The strName variable contains the string
17. The IDE stands for _ _ _ _ __ "Joyce". Which of the following
A. Informal Development Environment statements changes the contents of the
B. Internal Development Environment variable to the string "Joy"?
C. Integrated Development Environment A. strName = strName.Remove(3)
D. Integrated Deployment Environment 8. strName = strName.Remove(4)
18. Which of the following statements C. strName = strName.Remove(4, 2)
invokes the GetArea Sub procedure, D. strName = strName.Remove(2, 3)
passing it two variables by value? 25. Which of the following statements sends
A. GetArea(dblLength, dblWidth) As the focus to the btnClear control?
Double A. btnClear.Focus()
B. GetArea(ByVal dblLength, 8yVal B. btnClear.Focus() = True
dbl Width) C. btnClear.SendFocus()
C. GetArea 8yVal(dblLength, dblWidth) D. btnClear.SetFocus()
D. GetArea(dblLength, dblWidth) 26. Which property specifies the number of
19. Which type of procedure returns a value characters that a text box will accept?
to the caller code? A. Length
A. sub B. MaxLength
8. property C. LengthMax

S. Alhassan, Page 3 of 7
\NDEX NU~\\3ER: ........................... ..
' '' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .' ' '
•••••••••••••••••••···········
D Muxinmm f \'~- C. And. Or. Not
"'7 ,~:hich of the following Jcdai:es a I
... •
~l~ment on~-dim.~ns\onul ,lTT'l....
' I \ ) o. And. Or. [f . .
A. Dim intSolJ{4) As lnteger , . '\, How can an appltcat
"' .. •)1on access the f>ri~ ~
13. Din, intSold(5) As h,t~g~r == vuriubles in u clus:s.
... . ) I I

')' ") \ 78 · 6:,, ,\. dir~ctly


01
.. J, .. , 78 6-
c. .., } intSoldO As lntegcr = l·t
')' Dim
.. J, ..
· ), B.
using propertil!s created by Ptiblic
D. Both A and C. Property procedures .
28. Consider the st:.uenwnt: C. through Private procedures contained
in th~ class
Dim intSal es() As Intege r=
110000 , 12000, 900, soo, D. None of the above. . .
2000Q} 34
_Which of the followi~g 1~stanttates a_n
The staten,em intSal es (2) += 10 ltern(nfo
\~ill -_~ ____ .__ • variabl~'? object and assigns 1t to the chair
A. rePtuce the 900 amount with I0 A. Dim chair As lteminfo
B. replace the 900 amount wi1h 910 B. Dim chair As New ItemJnfo
C. replace the 12000 amount with 10 C. Dim chair"" New ItemJnfo
D. replace the 12000 amoun1 with 12010 D. Dim New chair As ltemfnfo
29. \Vhich of the fo IIowing assigns the string
"Rover" to the fifth element in a one- 35. Which of the following objects provides
the connection between
din,ensional array named strPetNames?
A. strPetNrunes(4) = "Rover" and a control on a form? a DataSet object
A, Bound
B. = "Rover" B. Binding
C. strPetNarnes(S) = "Rover"
C. BindingSource
D. strPetNames.ltems.Add(S) = "Rover" D. Connecting
30. Vihich of the following declares a two.
dimensio nal array that has four rows nnd
three columns? 36. Which of the following objects connects
a database to a DataSet object?
A. Dim decNums(2, 3) As Decimal A. BindingSource ·
B, DataBase
B. Dim decNums(3, 4) As Decimal
C. DataGridVie\v
C. Dim decNums(3, 2) As Decimal
D. Dim decNums(-1, 3) As Decimal 37 D. TableAdapter
31. Which of the following can be used to • \\.'hich of the r II · .
0 0
detennine Whether the emptoy.ixt file
exists? SSN t"1.:.td
'-' rorn the Payr
t' Wingf ""'1 11bl select the
son the records 10 • d n °ct·ta e anct then
A. If IO.File.Exists("emptoy.txt") Then the SSN field? escen 1ng Order by
B. If IO. File(" employ.txt"). E:-.:ists Then A. SEL1:c1 SSN FRol\,[ p. . '
C.
ThenIf 10.Exists("employ.txt") = True B. SELEc t SSN F ay Into DEsc
ORDER By SSN Dtsc ROi\,f Paylnfo
D. If 10.Exists.File\"employ.txt") = True
Then C. SELECT SSN F
W!-!ER.E SSN DEsc ROi\,[ Pay[nfo
32. The three 111uin logical operators are D. SELECT SSN FRo
_ • _, _ SSN DEsc
A. Falst!. And, Tnte _, Und - - - · 38. \Vhich of the t'olto\L' M Pay[nfo SOR.1
13. Or, Not, If
vtng contro ls is
verify thut u contrt'"' · Used to
contains
• dutu'? o on a \V,.b e Page
A. FielJValidator
8. R~quirt!JFi~lJ

S. A.ihassa ~. Page 4 of .,
). rfB'C
D •
............
•~Dnx N\J \..'I l (LJ l'... . • ... • ... • • • ••••• • • ••••• .... .. , , , , . , , .. , , • • • • • • • • • • • • • • • •
••• •• • ' •• •• ••••

C. Req_utreufte\u\/ a\iuator 40. You use _ _ _ _ _ _ _ to pau


se
D. Req_utreu\T a\idator program execution at a specific line in the
j9 .1\\e \)rocess of \ocating and code.
fixing any
errors 1n a -ptogram is called A. a breakpoint
B. the Error List window
A.. 'oug-1rrooflng C. the Step Into option on the Debug
B. bug-eliminating menu
C. debugging D. the Stop Debugging option on the
D. errot remova\ Debug menu

SECTION B (35 MARKS)


INSTRUCTION: Answer QUESTION
1 and any other TWO (2) questions from this section.
l.
a) Consider the following statements.
(4 marks)
Dim x, y, z As Bo ole an

z = (x An dy) Or No t(x )

What is the value of z in each of the follo


wing cases?
1. If x = Tru e and y = Tru e then z
=?
11. lf x = Tru e and y = Fal se then z
=?
111. lf x = F_alse and y = Tru e then
z =?
1v. lf x = Fa lse and y = Fal se
then z =?
b) Identify the missing keywords (lab
elled A- D) in the following VB state
ments. (5
marks)

-A- cou nt As
--
B

For cou nt= 100


-C- 2 -D- -2
lstN um ber s.It em s.A dd (co
unt )
_E_ cou nt

I S. Alhassan, Page 5 of 7
IN D E X NUM
BER·.. .. .. .. ..
-
.. .. .. .. .. .. .. .. ..
.. .. .• •• •• •• •• • t

•• •• •• ••
• • •. t.
t t I It t t t I It I
I It
It t t It I It t I I

c) What is the va .
lue of the vana ble x a er the following statement have
ft
marks) been executed. (6

Dim x a s In
te g e r
i) x = 8 Xor 1
ii ) X = 8
Or 1
ii i) x = 8
And 1
2. Consider a
form which ha
s two text bo x
(lOmarks) controls tx tS
tu d e n ti
a. Write a D d an d tx tE x
im statement amScore.
that declares
(lmark) a String vari
able na m ed
b. Write a Dim s tr S tu d e n
statement that ti d .
c. Write a st declares a Sin
atement that as gle variable na
signs the cont m ed sn gE xa m
and without an ent o f the tx tS S co re . (l mar
y leading or tr tu d e n ti d co nt k)
d. Write a st ailing spaces ro l in up pe rc as
atement that as to the variable e
signs the cont s tr S tu d e n
sn g E x a m S co ent o f tx tE x ti d . (lmark)
re . (lmark) a m S co re co
e. Write an lf nt ro l to the va
clause that de riable
is empty. (2.S termines whe
marks) ther the text in
f. Write an If the s tr S tu
clause that de d e n ti d va ri
termines wheth ab le
greater than 70 er th e va
. (2.Smarks) lue in the sn g
g. Write a st E x a m .S co re
atement that cl variable
tx tE x a m S co ears the text co
re controls. (l nt en ts o f the tx tS tu
mark) d e n ti d an d
3. Consider
a VB.Net prog
for this purpos ram that proces
e and one list s the prices o f
box control (n food items. A
(l 0m ar ks ) amed ls tP r form ha s be en
ic e ) has been created
a. Write a st placed on it.
atement that de
sn g P r ic e . clares a proced
The array shou ure-level one-
b. Write a st ld contain 10 dimensional si
atement that as elements. (2m ngle array na
signs the valu arks) med
array. (2marks e 5.50 to the th
) ir d el ement in the sn
c. Write a st g P r ic e
atement that ad
(2marks) ds the number
7 to the first el
d. Write a st ement in the sn
atement that as g P r ic e arra
si gns the numbe y.
intCount variab r o f elements
le. ( l mark) in th e
e. Write a st sngPrice array
atement that as to the
intLastFood va signs the high
riable. (lmark) est subscript in
f. Write a For the sn g P r ic
.. .. Next block e array to the
control. (2mar to add all the elem
ks) ents of sn g P
4. r ic e into the
ls tP r ic e
a. W ha t is a variable?
b. State tw o ( l mark)
(2) rules for na
C. Consider a data
ming variables.
base table nam (2marks)
field contains ed Foo dS tu ff
text while It em that contains tw
P ri ce field is
numeric. o fields.
The It em N am
e

S. Alhassan, Pa
ge 6 of 7

--------
MBER: ....................................................... ' ... . •••••••
• • • • If • •
•••

:t NU
•••••••

e
. L INSE RT statem ent tha t ad ds the food ~,wAKYE" with pric
l. Wri~e an SQ marks)
15 .:,0 to the FoodStuff table. (2 the price of ..BANKU" to 20.
.. tem en t tha t chan ges
n. Write an SQL UPDATE sta
(2marks) ds all the food items and
... that display the recor
111. Write an SQL SELECT query
their Prices. (lmark) oves the record for the ItemName
. statemen t that rem
lV. Write an SQL DELETE
~'FRIED YAM". (2marks)
ed to de termi ne the obesi ty status of a person. BMI
l) value is us
5. The Body Mass Index (BM ei gh t) / (h eig ht) 2 ; where weight is in kg an
d
rm ula (w
can be calculated using ~e fo
n ca lled GE T _B M I of typ e single that takes as its
.Net func tio
height is in meters. Write ·a VB e sin gle of a body and return the BMI va
lue in 2
igh t of typ
argument the weight and he
ld be ab le to tak e care of the situation where height may
n shou
decimal places. Your functio
be zero. (lOmarks)

\
\ !

You might also like