Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Year 12 - Computer Studies Worksheet 4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

MINISTRY OF EDUCATION, HERITAGE & ARTS

YEAR 12 COMPUTER STUDIES

Strand 2 Visual Basic.Net Programming (VB.Net)

MULTIPLE CHOICE QUESTIONS


1. Which of the following type of variables are accessible to all procedures of a form in
VB.Net program?

A. Local C. Block level


B. Global D. Module-level

2. Which of the following Loop structure is not supported by VB.Net program?

A. For................Next C. Do................While
B. Do................Until D. For Each.......While
3. Which of the following are standard prefixes for the Button and Combo box controls
respectively?
A. btn and chb C. bto and cbo
B. btn and cbo D. cmd and cbo

4. A student is coding a program in VB.Net and wants to add a comment within the code to
show constant declaration. Which of the following is the best way for the student to
comment?
A. “Constants are declared”
B. {Constants are declared}
C. Rem Constants are declared
D. Comment: “Constants are declared”

Study the program given below and answer question 5.

If (intTotalMark>300) AND (intEnglishMark>=60) Then

lblMessage.Text = “Scholarship Granted”


Else
lblMessage.Text = “Sorry you do not qualify for scholarship”
Source: Personal Collection
5. What would be the output if Sam enters 310 and 62?
A. Scholarship Granted
B. Sorry you do not qualify for scholarship
C. lblMessage.Text = “Scholarship Granted”
D. lblMessage.Text = “Sorry you do not qualify for scholarship”

Copyright© MEHA: FIJI: 2020


2

6. Which of the following vb.net code would close a form?


A. Me.Clear() C. Form.Exit()
B. Me.Close() D. Form.Close()

7. Which of the following programming techniques represents a program in diagrammatic


form.
A. Flow chart
B. Pseudocode
C. Program chart
D. Logical structures

8. Which of the following is correct vb.net code to display „Computer Studies‟ in a label
named lblSubject.
A. lblSubject.Computer Studies
B. lblSubject = “Computer Studies”
C. “Computer Studies” = lblSubject.Text
D. lblSubject.Text = “Computer Studies”

9. Visual Basic (VB) has become such a popular programming language for several
reasons. Which year was VB programming language first introduced?

A. 1973 C. 1991
B. 1995 D. 1989

10. Which of the following symbols is used to indicate an input/read or output operation?

A. C.

B. D.

11. Finding and fixing bugs in any computer program is called

A. fixing.
B. bugging.
C. defixing.
D. debugging.

12. Which numbering system is used in computer programming?

A. Octal
B. Binary

©MEHA: FIJI: COMPUTER STUDIES WORKSHHET - 2020


3

C. Decimal
D. Hexadecimal

Study the program given below and answer questions 11 and 12.

Read 3 numbers

Add 3 numbers

Calculate the average

Display average

13. The above diagram shows a structured program called

A. iteration structure.
B. selection structure.
C. sequence structure.
D. repetition structure.

14. What would be the average displayed when these numbers 2, 4, 6 are entered?

A. 2 C. 4
B. 3 D. 6

SHORT ANSWER QUESTIONS


15. Explain how objects and properties are related.

16. Visual Basic is event driven. What does this mean?

17. The first step to writing a good visual application is to have a good design of the user
interface. List the other two steps.

18. Explain one difference between a Do/Loop and a For/Next loop.

19. Describe when radio buttons are to be used instead of check boxes in a group box.

©MEHA: FIJI: COMPUTER STUDIES WORKSHHET - 2020


4

20. When a programmer starts executing a program, the first step is called compiling.
Define clean compile.

21. A student is writing a program and asked you to help in declaring a variable MYNAME
to hold the student‟s name. Use Dim to write a one line code to declare the variable.

22. Differentiate between a pretest and a posttest in a Do/Loop.

23. Study the VB.Net programming code for btnShow and answer the questions below.

Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnShow.Click
Dim count As Integer
For count = 1 To 4
lblOutcome.Text = lblOutcome.Text & vbNewLine & “Education”
Next
End Sub

(i) What is the purpose of command vbNewLine?


(ii) What will the output of the program be when user presses btnShow?
24. Study the VB.Net programming code for btnArea and answer the questions
below.

Private Sub btnArea_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnArea.Click
Line 1 Dim intlength,intwidth, intArea As Integer
Line 2 intlength = Integer.Parse(txtlength.Text)
Line 3 intwidth = Integer.Parse(txtwidth.Text)
Line 4 intArea = intlength + intwidth
Line 5 lblResult = intArea

End Sub

(i) Identify a line which shows


(a) logic error
(b) syntax error
(ii) After correcting the errors, 5 and 3 were fed in as length and width.
Display the output.

©MEHA: FIJI: COMPUTER STUDIES WORKSHHET - 2020


5

25. Design a user interface that has following:

 two textboxes (txtNum1, txtNum2) to accept two numbers


 a display label (lblProduct) to display the product
 a button (btnProduct) to calculate the product
 an exit button

26. State one purpose of an Integrated Development Environment (IDE).

27. Describe when a programmer should use a masked textbox instead of a normal textbox in
a VB.Net program.

28. Jerrys Infotech Limited is a company that sells a wide range of office equipment to
schools and offices around the country. Due to the high demand from the customers, the
company has hired 20 employees to run the sales department. The company pays its sales
team a weekly wage of $250 plus commission made on all sales. The commission are as
follows:
Sales Commission
>=10 000 3%
>=15 000 6%
>=20 000 9%

Draw a flow chart for the program in the Answer Booklet that will enable the
following:
 Request the user to enter the employee's name and the total sales for the week.
 Calculate the salary.
 Display the employee's name and the weekly salary.
Use the FOR…NEXT and IF…THEN…ELSE structure in the flow chart.

29. Start a new project. Add a textbox, a Label and a button to your new Form. Then write a
programme that does the following:

a. Asks users to enter a number between 10 and 20.


b. The number will be entered into the Textbox.
c. When the Button is clicked, your Visual Basic code will check the number entered in
the Textbox.
d. If it is between 10 and 20, then a message will be displayed.
e. The message box will display the number from the Textbox.
f. If the number entered is not between 10 and 20 then the user will be invited to try
again, and whatever was entered in the Textbox will be erased

©MEHA: FIJI: COMPUTER STUDIES WORKSHHET - 2020

You might also like