0% found this document useful (0 votes)
11 views24 pages

CSC 215 Practice Questions

The document contains multiple-choice questions related to Visual Basic programming, covering topics such as variable declaration, arithmetic operations, conditional statements, and control properties. It tests knowledge on syntax, data types, and the functionality of various controls within the Visual Basic environment. The questions are designed to assess understanding of programming concepts and the Visual Basic language specifically.

Uploaded by

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

CSC 215 Practice Questions

The document contains multiple-choice questions related to Visual Basic programming, covering topics such as variable declaration, arithmetic operations, conditional statements, and control properties. It tests knowledge on syntax, data types, and the functionality of various controls within the Visual Basic environment. The questions are designed to assess understanding of programming concepts and the Visual Basic language specifically.

Uploaded by

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

Multiple choice Questions

On
Visual Basic

What is the correct statement when declaring and assigning the value of 100 to an
Integer variable called numPeople
A. Dim numPeople =
B. Dim numPeople = Int(100)
C. numPeople = 100
D. Dim numPeople As Integer = 100

Which of the following arithmetic operations has the highest level of precedence?
A. + –
B. * /
C. ^ exponentiation
D. ( )
What value will be assigned to the numeric variable x when the following statement
is executed? x = 2 + 3 * 4
A. 20
B. 14
C. 92
D. 234

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


A. Two_One
B. 2One
C. Two One
D. Two.One
A variable declared outside of an event procedure is said to have class-level
scope.
A. True
B. False

Option Explicit requires you to declare every variable before its use.
A. True
B. False

The value returned by InputBox is a string.


A. True
B. False
What is the correct statement when declaring and assigning the value of 100 to
an Integer variable called numPeople
A. Dim numPeople =100
B. Dim numPeople = Int(100)
C. numPeople = 100
D. Dim numPeople As Integer = 100

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


[A] Real time
[B] Graphical User Interface
[C] Character User Interface
[D] None Of These
_________ is used for finding out about objects, properties and methods.
[A] Form layout window
[B] Code editor window
[C] Object browser
[D] None of the above
In Visual Basic, a variable name cannot be more than __________ characters.
[A] 255
[B] 300
[C] 355
[D] 400
Which value for x would make the following condition true: (x >= 5) And (x <= 6)
A. x is equal to 7
B. x is equal to 5
C. x is equal to 5.001

Constructs in which an If block is contained inside another If block are called:


A. multi-If blocks
B. nested If blocks
C. sequential If blocks
D. none of the above
___________ function is used to return a copy of a string without leading spaces.
[A] Rtrim
[B] Ltrim
[C] Trim
[D] All of the above
The variables that does not change the value during execution of program is
__________
[A] Numeric
[B] String
[C] Constant
[D] None of the above
___________ is a method which moves the focus to the specified control or
form.
[A] Setfocus
[B] Lostfocus
[C] Gotfocus
[D] None of these
The function procedures are ___________ by default.
[A] public
[B] private
[C] protected
[D] None of the above
__________ is a data type that can be used to declare a text of maximum 10
million characters.
[A] Date
[B] Ulong
[C] Numeric
[D] String
Variables are named storage locations in memory, the value of which does not
change during program ___________
[A] debug
[B] design
[C] execution
[D] All of the above
Which of the following is a valid Visual Basic conditional statement?
A. 2 < n < 5
B. 2 < n Or < 5
C. 2 < n Or 5
D. (2 < n) Or (n < 5)
The three main logical operators are ________, _________, and ________.
A. And, Or, Not
B. And, Not, If
C. Or, Not, If
D. False, And, True
Which value for x would make the following condition true: x >= 5
A. x is equal to 7
B. x is equal to 5
C. x is equal to 5.001
D. all of the above
Which value for x would make the following condition true: Not (x >= 5)
A. x is equal to 7
B. x is equal to 4
C. x is equal to 5.001
D. x is equal to 5.001
In visual basic ______ is the extension to represent project file.
[A] .frm
[B] .vbp
[C] .cls
[D] .vb
The default property for a text box control is __________
[A] Text
[B] Enable
[C] Multiline
[D] Password char
__________ is a collection of files.
[A] Class
[B] Group
[C] Project
[D] All of the above
The method, which loads the form into memory and displays it on screen
[A] Load
[B] Show
[C] Display
[D] All of these
The code in an application can be broken into logical components by _______
process.
[A] modular
[B] procedural
[C] partitioning
[D] None of the above
The ________ object is a stored query definition, which is a precompiled SQL
statement.
[A] QueryFed
[B] QueryDif
[C] QueryFix
[D] QueryDef

________ function returns the intervals between two dates in terms of years,
months or days.
[A] DateDiff( )
[B] DateIn( )
[C] DateFix( )
[D] DiDate( )
______ array size can be changed at run-time.
[A] Fixed
[B] Preserve
[C] Dynamic array
[D] Multidimensional
The window in which the individual documents are displayed is called
____________window.
[A] Main
[B] Child
[C] Parent
[D] Root
_________ is the process of finding and removing errors.
[A] Checking
[B] Compiling
[C] Debugging
[D] Quick watch
_______ loop repeats a group of statements for each item in a collection of
objects or for each element of an array.
[A] While loop
[B] Do Until loop
[C] Do while loop
[D] For each loop
A __________ variable is one that is declared inside a procedure.
[A] global
[B] local
[C] external
[D] None of the above
_______ control executes the timer events at specified intervals of time.
[A] Clock
[B] Frame
[C] Timer
[D] Digital
MDI stands for _________
[A] Multiple Document Interface.
[B] Multiple Design Interface.
[C] Manipulated Document Interface.
[D] Menu Design Interface.
A _______control in visual basic is used to create applications that present
information in rows and columns.
[A] MSGridLine
[B] MSLineGrid
[C] MSGridFlex
[D] MSFlexGrid
__________ cannot be declared in a form or class module.
[A] Static constants
[B] Private constants
[C] Public constants
[D] None of these
__________ do not return a value.
[A] Sub procedure
[B] Function procedure
[C] Property procedures
[D] All of these
The default datatype for VB is ___________
[A] Integer
B] Decimal
[C] Variant
[D] String
_________ is a built in function to return lower bound of an array.
[A] Lbound()
[B] LRbound()
[C] Lowbound()
[D] None of these
The _________ allows direct exit from a For loop, Do loop, Sub procedure, or
Function procedure.
[A] Break
[B] Exit
[C] Exit for
[D] Exit Do

Which of the following arithmetic operations has the highest level of precedence?
A. + –
B. * /
C. ^ exponentiation
D. ( )
What value will be assigned to the numeric variable x when the following
statement is executed? x = 2 + 3 * 4
A. 20
B. 14
C. 92
D. 234
Which of the following is a valid name for a variable?
A. Two_One
B. 2One
C. Two One
D. Two.One
Keywords in Visual Basic are words that
A. should be used when naming variables.
B. are used to name controls, such as TextBox1, Command2, etc.
C. have special meaning and should not be used when naming variables.
D. are used as prefixes for control names (such as txt, btn, lbl, and lst).

To continue a long statement on another line, use:


A. an underscore character.
B. an ampersand character.
C. Ctrl + Enter.
D. a space followed by an underscore character.
What is the proper syntax when using a message dialog box?
A. MessageBox.Show(“Hi there”, “Hi”)
B. MessageBox.Show(Hi there, Hi)
C. MessageBox.Show “Hi There”, “Hi”
D. MessageBox.Show Hi There, Hi
What will be the output of the following statement? txtBox.Text =
FormatCurrency(1234.567)
A. $1234.567
B. 1,234.57
C. $1234.57
D. $1,234.57
The following lines of code are correct. If age >= 13 And < 20 Then txtOutput.Text
= “You are a teenager.” End If
A. True
B. False
Given that x = 7, y = 2, and z = 4, the following If block will display “TRUE”. If (x >
y) Or (y > z) Then txtBox.Text = “TRUE” End If
A. True
B. False

Asc(“A”) is 65. What is Asc(“C”)?


A. 66
B. 67
C. 68
D. “C”
Asc(“A”) is 65. What is displayed by txtBox.Text = Chr(65) & “BC”?
A. ABC
B. A BC
C. 656667
D. Not enough information is available.
Which of the following expressions has as its value the words “Hello World?
surrounded by quotation marks?
A. “Hello World”
B. Chr(34) & “Hello World”
C. Chr(34) & Hello World & Chr(34)
D. Chr(34) & “Hello World” & Chr(34)

Which of the following is true?


A. “Cat” = “cat”
B. “Cat” < “cat”
C. “Cat” > “cat”
D. Relational operators are only valid for numeric values.___________ displays
current directory with any subdirectories and allows the user to change directory.
[A] FileListBox
[B] DirListBox
[C] DriveListBox
[D] All of these
Extension of ActiveX designers ____________
[A] .dsr
[B] .axd
[C] .adx
[D] None of these
(32) ________ indicates whether a particular condition is on or off.
[A] Text box
[B] Check box
[C] List box
[D] Combo box
__________ statement enables us to trap runtime error.
[A] Error
[B] On Error
[C] On runtime Error
[D] All of these
Frame Control acts as a __________
[A] Event
[B] Method
[C] Class
[D] Container
Form_Mouse Down( ) procedure is executed when any mouse button is clicked in
a free area of the ______.
[A] form
[B] window
[C] screen
[D] None of these
________ method removes a dialog box from view.
[A] Enabled
[B] Disable
[C] Hide
[D] Display
The ______ is a tool used for both the Input and output purpose.
[A] label
[B] text box
[C] Combo box
[D] command button
(38) In visual basic the declaration of variables is done by _____ key word.
[A] int
[B] dim
[C] static
[D] declare
An object datatype can store _______ bytes.
[A] 1 byte
[B] 2 byte
[C] 4 byte
[D] 8 byte
________ method is used to clear the contents of MSHFlexGrid control.
[A] Clr
[B] Cls
[C] RemoveItem
[D] Clear
The _______ function returns a string stored in a variant data type.
[A] Chr.
[B] Str.
[C] Char.
[D] None of these
The __________ property is used in VB for maximum form at run time.
[A] caption
[B] window resize
[C] window status
[D] none of these
___________ is property is used to hide the content in textbox with some
symbols.
[A] Name
[B] Caption
[C] Hidden
[D] Password char
___________ method is used to retrieve the stored text from the clipboard.
[A] Input
[B] Gettext
[C] Addtext
[D] Settext
_________ control displays current directory with any sub directories and allows
the user to change directly.
[A] File list box
[B] Drive list box
[C] Directory list box
[D] All of the above
________ control is used to represent the items in a hierarchical manner.
[A] Tree view
[B] Grid view
[C] Progress bar
[D] None of these
Which is not a property of the Common control class?
[A] Show
[B] Font
[C] BackColor
[D] ForeColor
Which symbol creates an access key in the text of a menu item?
[A] @
[B] &
[C] $
[D] #
__________ event occurs when a form loaded into the memory.
[A] Load
[B] Activate
[C] Initialize
[D] None of the above
_______ method is used to forcibly set the CPU focus to a particular control.
[A] Setfocus
[B] Gotfocus
[C] Lostfocus
[D] None of the above
IDE stands for…………
[A] Integrated Desktop Environment
[B] Integrated Development Environment
[C] Integrated Dual Environment
[D] Internet Development Environment
Which windows displays a list of all forms and modules making up your
application?
[A] Project window
[B] Properties window
[C] Form layout window
[D] All of the above
Properties can be viewed in two ways
[A] Alphabetic and Categorized
[B] Alphabetic and Numeric
[C] Numeric and Alphanumeric
[D] None of these
Which of the following windows is the central to the development of Visual Basic
applications?
[A] Project window
[B] Form window
[C] Properties window
[D] All of the above
Which of the following provides quick access to commonly used commands in the
programming environment?
[A] Toolbox
[B] Object browser
[C] Toolbar
[D] None of these
One or more option button controls can be selected from _____ choices
[A]multiple
[B] single
[C] dual
[D] parallel
_____ bar contains a set of tools to provide controls in the same
[A] Status
[B] Tool
[C] Menu
[D] Progress
Debug window is the same as ____ window
[A] procedure
[B] object
[C] form
[D] code
A module-level is available to all the _______ in the module
[A] data
[B] procedures
[C] event
[D] task
______variables are not reinitialized each time Visual basic invokes a procedure
and thus retains or preserves value even when a procedure ends
[A] Static
[B] Dynamic
[C] Virtual
[D] Currency
In ……………… window we can write code
[A] Immediate window
[B] Locals window
[C] Code editor window
[D] None of these
The form module has file extension ….
[A] .frb
[B] .fra
[C] .frm
[D] .fru
A text box can hold as many as …...…. characters for a single line text
[A] 2052
[B] 2048
[C] 2058
[D] 2047
A text box can hold as many as ……… characters for a multi-line text
[A] 42000
[B] 48000
[C] 23000
[D] 32000
……….. control is used to provide an identifiable grouping for other controls
[A] Frame
[B] List box
[C] Check box
Code window consists of a ______ box and procedure list box
[A] object
[B] event
[C] tool
[D] message
The ____ statement checks in the module for usage of any undeclared variables
and reports an error to the user
[A] looping
[B] iteration
[C] dim
[D] external
_____ function translates a numeric value to a variable
[A] Message
[B] Build In
[C] Val
[D] Mod
…………. control is used to display text, but user cannot change it directly
[A] Textbox
[B] Labelbox
[C] Listbox
[D] Commandbutton
We can preserve the value of a local variable by making the variable………
[A] Private
[B] Public
[C] Static
[D] Implicit
………. arrays can be resized at anytime
[A] Dynamic
[B] Fixed
[C] Multidimensional
[D] Control array
4…………. is a block of code that is executed in response to an event
[A] Function procedure
[B] Sub procedure
77th[C] property procedures
[D] All of the above
All the following statements are true about variable scope except
[A] Module
[B] Global
[C] Static
[D] Local
All the controls in an array will have the same _____
[A Value
[B] properties
[C] address
[D] location
The _____ property in Visual basic is common for many a tools
[A] location
[B] place
[C] window status
[D] name
The Visual Basic Code Editor will automatically detect certain types of errors as you
are entering code.
A. True
B. False

Keywords are also referred to as reserved words.


A. True
B. False
The divide-and-conquer-method of problem solving breaks a problem into large,
general pieces first, then refines each piece until the problem is manageable.
A. True
B. False

Visual Basic responds to events using which of the following?


A. a code procedure
B. an event procedure
C. a form procedure
D. a property
When the user clicks a button, _________ is triggered.
A. an event
B. a method
C. a setting
D. a property
What property of controls tells the order they receive the focus when the tab key is
pressed during run time?
A. Focus order
B. Focus number
C. Tab index
D. Control order

Sizing Handles make it very easy to resize virtually any control when developing
applications with Visual Basic. When working in the Form Designer, how are these
sizing handles displayed?
A. A rectangle with 4 arrows, one in each corner, around your control.
B. A 3-D outline around your control.
C. A rectangle with small squares around your control.
D. None of the above.

The Properties window plays an important role in the development of Visual Basic
applications. It is mainly used
A.to change how objects look and feel.
B. when opening programs stored on a hard drive.
C. to allow the developer to graphically design program components.
D. to set program related options like Program Name, Program Location, etc.

When creating a new application in Visual Basic, you are asked to supply a name for
the program. If you do not specify a name, a default name is XXXXX XXXXX is this
default name?
A. Wapplication followed by a number.
B. Application followed by a number. C. WindowsApplication.
D. WindowsApplication followed by a number.

Which of the properties in a control’s list of properties is used to give the control a
meaningful name?
A. Text
B. ContextMenu
C. ControlName
D. Name
Pseudocode is
A. data that have been encoded for security.
B. the incorrect results of a computer program.
C. a program that doesn’t work.
D. the obscure language computer personnel use when speaking.
E. a description of an algorithm similar to a computer language.
n algorithm is defined as:
A. a mathematical formula that solves a problem.
B. a tempo for classical music played in a coda.
C. a logical sequence of steps that solve a problem.
D. a tool that designs computer programs and draws the user interface.

A variable declared inside an event procedure is said to have local scope


A. True
B. False
A variable declared outside of an event procedure is said to have class-level scope.
A. True
B. False
Explicit requires you to declare every variable before its use.
A. True
B. False
The value returned by InputBox is a string.
A. True
B. False

Compiled By:- Jay_Mhorsh

Physics Department

You might also like