programming cba
DESCRIPTION
Programming VBATRANSCRIPT
I. Chapter 6 1,4,5,7,9,10II. Chapter 12 1 to 10III. Chapter 5 1 to 3, 5 to10IV. Chapter 7 1, 3 to10V. Midterm 2 Except Q 14,15, 22, 23 33,43VI. Extra Credit Quiz VII. Chapter 11 -
Chapter 6 Procedures and Functions
1 A procedure may not be access by procedures from another form if the ___ access specified is used
Private
4 Which statement is true in regard to passing an argument by value to a procedure?
A copy of the argument is passed to the procedure.
5 Which of the following does not apply to procedures and functions?
The execution time is significantly reduced by calling procedures and functions
7 All of the following are true about functions except __
They can return one or more values
9 When a procedure finishes execution,
Control returns to the point where the procedures was called and continues with the statement
10 If you do not provide an access specifier for a procedure, it will be designated __ by default
Public
Chapter 12 Classes, Collections, and Inheritence
1 A __ defines a special type of class member that contains Get and Set sections.
Property procedure
2 Client programs can query __ to get values, but they cannot modify them
Readonly properties
3 Why is important to remove objects that are no longer need in your program?
To free up memory for other uses
4 A constructor is a method named __ found inside the class.
New
5 A instance of a class is also called __
An object
6 Object oriented analysis starts with __
Finding the classes
7 The hiding of data and procedures inside a class is achieved through a process called __
Encapsulation
8 A variable declared inside a class is also known as a __
Member variable
9 The __ access specifier permits class members to be accessed only by statement inside the class
Private
10 The__ access specifier permits class members to be accessed both outside the class and outside assembly
Public
Chapter 5 List and Loops
1 Which of the following controls and methods provides a simple way to gather input from the user at runtime without placing a text box on a form?
Input
2 Which type of loop repeats as long as its loop condition remains True?
Do While
3 Which statement is True in regard to the following code?
intCount = 0Do while intCount listOutput.items.add(Good job)Loop
This is an infinite loop
5 The Inputbox function always returns a __ value
String
6 A counter is a __ that can be incremented or decremented each time a loop runs
Integer Value
7 In the following statement that begins a For Next loop, what is the purpose of the Step Clause?
For IntX = 1 to 100 step 5
It causes intX to be incremented by 5 each time the loop repeats
8 To get the number of items stored in a listbox, use the __ property.
Items.Count
9 The first item in a listbox has index of __
0
10. The method erases all the items in a listbox.
Items.clear
Chapter 7 Multiple Forms, Standard Modules, and Menus
1 Which of the following statements properly descrie the Me Keyword
The Me keyword refers to the current instance of the form?
3 Which of the following will display the getStudentdataform form such that the programming statements that follow will not execute until the getstudentdataform is closes
getstudentdatafrom.showdialog()
4 All of the following are true about the hide method of a form except __
Using the hide method removes the form from memory
5 A variable is accessible to statements outside the form if declared __
as Public and class-level
6 In order to add a menu to a form, you must place a __ on the form.
Menustrip Control
7 An event handler for a menu item is created by __ in design view.
Double clicking the menu item
8 The primary reason to use standard menu items, such as File, Edit, Help is __
Most users expect to see these items
9 When a __ form is displayed, no other form in the application can receive the focus until the form is closed
Modal
10 All of the following are true of the show method of a form except:
The displayed form must be closed before you can access other forms
Midterm 2
1 The __ control is used to gather input the user has typed at the keyboard.
Textbox
2 Variables declared within a buttons click event are __ variables
local3 The __ operator performs string concentration
ampersand (&)
4 What will be the value of intAnswer after execution of these statements?
Const intnumA as Integer = 6Const intnumB as integeter 2Int Answer = IntnumA/IntnumB + IntnumA * IntnumB
15
5 The order in which controls receive the focus is called the __
tab order
6 To convert a copy of a string to all uppercase letters, use the __ method of the String object.
To upper
7 What value is assigned to the variable strSnip when the following statements execute?
Dim strSnip as StringDim strFullstring as Str = WashingtonStrSnip = StrFullstring.Substring(1,3)
Ash
8 What value will be assigned to intIndex when the following statements execute?
Dim strtarget as String = ASsdfghjlkDim intindex as integer = Strtarget.indexof(gas)
0
9 What value is assigned to sngTaxes by the following program segment, assuming that the user enters 50000 into the textbox txtSalary.text?
15000
10 If the Boolean expression A is True and B is fales, the value of the logical expression A or B is __
True
11 Which of the following controls and methods provides a simple way to gather input from the user at runtime without placing a textbox on a form?
Inputbox
12 Which type of loop repeats as long as its loop conditions remain True?
Do While
13 Which statement is True in regard to the following code?
Intcount = 0Do while intcount lstoutput.items.add(good job)Loop
The Items.Insert method should be used instead of items. Add
14 15
16The inputbox function always returns a __ value
String
17In the following statement that begins a For next loop, what is the purpose fo the step clause?
For intx = 1 to 100 step 5
It causes Intx to be incremented by 5 each time the loop repeats
18 To get the number of items stored in a Listbox, use the __ property
items.count
19The first item in a listbox has an index of __
0
20 The method erases all the items in a listbox.
Items.clear
21 A procedure may not be accessed by procedures from another form if the __ access specifier is used
Private
22 23
24 Which statement is true in regard to passing an argument by value to a procedure?
A copy of the argument is passed to the procedure
25 which of the following code examples is a function that will accept three integers parameters, calculate their average, and return the result?
Function Average(by val intx as integer, by val inty as integer, _By val intz as integer) as single
Return (intx + inty+ intz)/3 End Function
26 What is incorrect about the following function?
Fucntion sum(byval intx as integer, by val inty as integer) as integer
Dim intAns as IntegerIntAns = IntX +IntYEnd Function
The function does not return a value
27 All of the following are true about functions except __
they can return one or more values
28 What will be the value of dblSum after the button btnadd is clicked, assuming that 25 is entered by the user into Txtnum1, and 35 is entered into txtnum2?
60
29Which of the following can be returned by a function?
All of the Above
30 When a procedure finishes execution, __
Control returns to the point where the procedure was called and continues with the next statement
31 Which of the following procedure calls to the GetAnumber subproceude is not valid?
Sub GetaNumber(byval intnumber as integeter) (procedurebody)End Sub
GetA number(inx+ 3,inty)
32 Which of the following statements properly describe they keyword?
The Me keyword refers to the current instance of the form.
33
34 All of the following are true about the hide method of a form except __
using the hide method removes the form from memory
35 A variable is accessible to statements outside the form if declard __
as Public and Class-level
36 In order to add a menu to a form, you must place a __ on the form
Menu Strip Cntrol
37 An event handler for a menu item is created by__ in design view..
Double clicking the menu item
38 The primary reason to use standard menu items such as File, Help, Edit is __
Most users expect to see these items.
39 When creating a form in visual basic, code is associated with that form is stored in a file with a __ extension
vb
40 An instance of a form is created using a __ statement with the New Keyword.
Dim
41 All of the following are true of the show method of a form except:
The displayed form must be closed before you access other forms
42 Values stored in an array can be accessed using a __
subscript
43
44 Due to their similarities, its easy to create a parallel relationship between an array and a __
Listbox
45In the array declaration below, what is the significance of the number 17?
Dim strNames (17) as String
Its the upper bound (highest subscript value) of the array
46 How many elements can be stored in the following array?
Dim snggrades (2,3) as Single
12
47 Which of the following statements define a two deimensional integer array named intwoDarray with 6 rows and 4 columns
Dim intoDarray(5, 3) as Integer
48 What value should be placed in a timer controls interval property to trigger a Tick event every 10 seconds?
10000
49 The lowest possible subscrip of an array is __
0
50 Which of the following provides the index of the highest numbered element of the array strnames?
Strnames.length -1
Extra Credit Quiz
1 All of the following are major hardware components of a typical computer system except __
Operating system
2 Programs should use comments (remarks) to __
Help the human reader of the program
3 The properties of a control are listed in the __ window
properties
4
Chapter 11
1 This was the first server-side web programming technology introduced by Microsoft
ASP
2 A web form can be identified by its __ file name extension
.aspx
3 Which of the following is not a web browser?
Windows explorer
4 Which method allows the user to navigate to another web page?
Response redirect
5 Asp.net controls are more powerful than HTML controls because __
they use event handlers to carry out actions at runtime
6 Which of the following is true regarding asp.net?
ASP.NET provides many controls that are similar to those used in Windows forms
7 Web applications are designed around a __model, meaning the one computer produces data while another uses data.
Client Server
8 Program should use comments (remarks) to __
All of the above
9 The __ control is used to gather input the user has typed as the keyboard
textbox
10 Variables declared within a buttons click event are __ variables
local