0% found this document useful (0 votes)
3 views5 pages

ComputerScience-II-VB-Optional

The document is a model question paper for the H.S.C. Annual Examinations 2021 in Computer Science, specifically focusing on Programming Using Visual Basic. It includes multiple-choice questions, short answer questions, and detailed answer questions covering various aspects of Visual Basic programming. Candidates are required to attempt questions from specified sections within a set time limit.

Uploaded by

akbahi893
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)
3 views5 pages

ComputerScience-II-VB-Optional

The document is a model question paper for the H.S.C. Annual Examinations 2021 in Computer Science, specifically focusing on Programming Using Visual Basic. It includes multiple-choice questions, short answer questions, and detailed answer questions covering various aspects of Visual Basic programming. Candidates are required to attempt questions from specified sections within a set time limit.

Uploaded by

akbahi893
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/ 5

BOARD OF INTERMEDIATE EDUCATION, KARACHI

H.S.C. Annual Examinations 2021

(MODEL QUESTION PAPER)


NOTE: This paper comprises Two independent options – (I) Programming Using ‘C’ and (II) Programming Using Visual
Basic. The candidates have to attempt any One Option, Programming Using ‘C’ OR Programming Using Visual
Basic, whichsoever they have offered.

COMPUTER SCIENCE PAPER-II


(PROGRAMMING USING ‘VISUAL BASIC’
(OPTION – II)

Total Duration: 02 Hours


Total Marks: 75 SECTION "A" (M.C.Qs) Marks: 36

Note:-Answer All Questions from this section or Compulsory Question-1:-

1. i. Visual Basic language is called?

 mnemonic  Machine
 Object-Oriented/ Event-Driven  Procedure-oriented.

ii. The variables that does not change the value during execution of program is __________

 Numeric  String
 Constant  Alphanumeric

iii. A translator translates the entire high-level language program into machine code is called?

 Assembler  Compiler
 Interpreter  Instruction

iv. The function procedures are ___________ by default.

 public  private
 protected  Dimension

v. A collection of files in VB is called:

 Class  Group
 Project  methods

vi. If a check box is checked, its value property is set to :

 0 (zero)  1 (one)
 2 ( two)  both 0 (zero) and 1 (one)
vii. When the user clicks a button, _________ is triggered.

 an event  a method
 a setting  a property

viii. The MsgBox function displays a dialog box that contains :

 One command button  A message pre-defined dialog box


 An optional Icon  Class

ix. If an option button is not selected, its value property is set to:

 0 ( zero)  1 ( one)
 True  False

x. SDI stands for?

 Single Document Interface  Single Development Interface


 Single Design Interface  Single Double Interface

xi. In visual basic ______ is the extension to represent project file.


 frm  vbp
 .cls  vb

xii. The tools in the toolbox allow you to add objects to a form called?

 Attributes  Command
 Code  Controls

xiii. Which of the following is a valid assignment statement in VB?

 txtName.Camption =‟college‟  txtName.Caption = “college”


 txtName.Text = „college‟  txtName.Text = “college”

xiv. The three types of repetition/loop structure are?

 Do-For, Do-Until, Do-While  Do-Until, Do-While, For-Next


 Do-Until, Do-While, For-Now  For-Next, For – Now, Do-For

xv. When you give the same name more than one control, you create a :

 control array  control group


 group  name array

xvi. The method used to remove items from the list box is called?

 RemoveItem  DeleteItem
 EraseItem  FinishItem
xvii. A standard structure for storing data in array X of VB format programming language?

 Salary = 34000  Salary ( 0 ) = 34000
 Salary [0] = 34000  Salary{0} = 34000

xviii. Visual Basic is a tool that allows you to develop application in __________

 Real time  Graphical User Interface


 Character User Interface  Disk Operating System

xix. If we use the Val function in VB. The Syntax is

 Val(number)  Val(string)
 Val($560)  Val(1234)

xx. Which of the following is a valid name in rules for naming variables in VB?

 98SalesCur  Cur98Sales
 Print  Form

xxi. When two procedures in different forms need to use the same variable, you declare the
variable as a

 Form-level  Global
 Local  Report-level

xxii. To display a VB form on the screen, use the method.

 Load method  Show method


 Unload method  Hide method

xxiii. The Ok and Cancel buttons are example of

 double click  Command buttons


 Command Window  Event Procedure

xxiv. An array size can be changed at run-time.

 Fixed  Preserve
 Dynamic array  Multidimensional

xxv. Which control displays current directory with any sub directories and allows the user to change
directly.

 FileListBox  DriveListBox
 DirListBox  DirectoryListBox

xxvi. ADO stand for

 Active Data Organization  ActiveX Data Object


 Action Data Object  ActiveX Database Object
xxvii. Which of the following arithmetic operations has the highest level of precedence?
 (+,–)  (*, /)
 ( ^ exponentiation)  None

xxviii. Each individual variable in the list student(0), student(1), student(2) is known as a(n)

 subscript  dimension
 element  type

xxix. Which of the following is a valid Visual Basic conditional statement?



 2<n<5  2 < n Or< 5
 2 < n Or 5  (2 < n) Or (n < 5)

xxx. The_____________is used for finding out about objects, properties and methods.

 Form layout window  Code editor window


 Object browser  Notepad

xxxi. Variables appearing in the header of a Function procedure are called ____________.

 values of the function  parameters


 coordinates  arguments

xxxii. The arguments appearing in a Call statement must match the parameters in the appropriate
Sub or Function header in all but one of the following ways. Which one?

 Number of arguments  Names of arguments


 Data type of arguments  Order of arguments

xxxiii. In Visual Basic, a variable name cannot be more than __________ characters.

 255  300
 355  400

xxxiv. Which of the following is a valid name for a variable?

 Two_One  2One
 Two One  Two.One

xxxv. What is the proper syntax when using a message dialog box?

 MessageBox.Show(“OK”, “Yes”)  MessageBox.Show(OK,Yes)


 MessageBox.Show “OK”, “Yes”  MessageBox.ShowOK,Yes

xxxvi. What value will be assigned to the numeric variable x when the following statement is
executed?
x = (2 + 3) * 4
 20  14
 92  234
SECTION-B (SHORT ANSWER QUESTIONS) (25 Marks)

NOTE:- Attempt Five question from this section( No Answer Should exceed 6-7 lines)

2. i. What are the uses of VB form and immediate window?


ii. How to select more than one control at a time?
iii. Define how to work the following program segment.

Dim number1, number2,number3 as Integer


Dim total, average as variant
Private sub Form_Click()
number1=val(Text1.Text)
number2=val(Text2.Text)
number3= val(Text3.Text)
Total=number1+number2+number3
Average=Total/3
Label1.Caption=Total
Label2.Caption=Average
End Sub
iv. Define VB applications can be viewed in three distinct states?
v. State in few lines of event-driven programming?
vi. Write a program in VB that generates odd-numbers from 1 to 19?
vii. What are the basic data types of VB?
viii. The AddItem and RemoveItem, where are these methods used to manipulate?
ix. Define If..Then...Else Statement .
x. What is the difference between ListBox and ComboBox

SECTION-C DETAILS ANSWERS QUESTIONS (14 Marks)

Note:-Attempt any Two Questions from this section

3. Write the few names of properties and methods that are commonly applying to most objects?

4. Write VB code, the output should be „Pakistan Zindabad‟ displayed on the PictureBox and operated by
pressing Command Button?
OR
What are the differences between GotFocus and LostFocus events? Give any one SetFocus example?

5. Differentiate Relational operators and Logical operators of VB? Give their symbols and purpose?

6. Write VB code to generate table of General n number that should be displayed by pressing Command
Button

You might also like