wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz on Visual Programming

Total questions: 145

Worksheet time: 2hrs 30mins

Name
Class
Date
1.

To change the Color Theme of Visual Studio .Net, which menu do we select?

a)

Tools/ Options/ General.

b)

View/ Toolbox.

c)

Extensions/ Customize Menu.

d)

Tools/ Customize.

2.

VB.NET allows users to set up applications according to?

a)

Console, Windows Form, ASP.NET.

b)

Windows Form.

c)

ASP.NET.

d)

Console.

3.

The term IDE stands for?

a)

Integrated Development Environment.

b)

Integrated Design Environment.

c)

Interior Development Environment.

d)

Interior Design Environment.

4.

The term CLR stands for?

a)

Common Language Runtime.

b)

Common Language Run.

c)

Class Language Runtime.

d)

Class Language Run.

5.

For the following code, what is the function of the Console.ReadKey() command? Sub Main() Console.WriteLine(Console.ReadLine()) Console.ReadKey() End Sub

a)

To pause the screen to view the result.

b)

To read data from the keyboard.

c)

This command is used to print values to the console.

d)

This command reads 1 character from the keyboard and returns an integer.

6.

To create a TextBox control on a Form, we use?

a)

Toolbox.

b)

Toolbar.

c)

Project Explorer window.

d)

Properties Window.

7.

In a Solution with 3 projects, to set a project as the default running project in the Solution, we select?

a)

Right-click on the project to run by default/ Set as Startup Project.

b)

In a Solution, there can only be one Project.

c)

The first created project is the default running project, it cannot be changed.

d)

Select My Project in the project to run by default, change the Startup form.

8.

The command that reads data from the keyboard until it encounters a newline character is?

a)

Console.ReadLine()

b)

Console.WriteLine()

c)

Console.WriteLine.

d)

Console.Read()

9.

The command that prints each value on a new line is?

a)

Console.WriteLine()

b)

Console.WriteLine.

c)

Console.Read()

d)

Console.ReadLine()

10.

For the following procedure: Sub Main() Console.WriteLine("Please enter Name, Age, Address:") Console.Write("Your name: " + Console.ReadLine() + ", " + Console.ReadLine() + " years old, living in " + Console.ReadLine() + ".") End Sub If the user enters: Marry, 20, California. What is the result?

a)

Your name: Marry, 20 years old, living in California.

b)

The program reports an error.

c)

Your name: Marry 20 years old living in California.

d)

Your name: Marry + 20 years old + living in California.

11.

What is the result of the following program? Dim a, b As String a = "1" b = "2" MsgBox(a + b)

a)

12.

b)

3.

c)

Error on line 1.

d)

Error on line 4.

12.

Assuming the value x=10. Which of the following commands will print the result in the textbox named txtKetQua?

4 lines
13.

How many is the result of the expression?

4 lines
14.

Assuming x=10. Which statement will print the result in the textbox named txtKetQua?

a)

txtKetQua.Text=str(x)

b)

Print(x.KetQua)

c)

txtKetQua.Print(x)

d)

txtKetQua.x=10

15.

Variable names, constants, and subroutine names cannot use which of the following characters?

a)

Space.

b)

Uppercase letters.

c)

Digits.

d)

Lowercase letters.

16.

To use x raised to the power of y, which function or operator should be used?

a)

x ^ y

b)

exp(x,y)

c)

pow(x,y)

d)

Another function.

17.

To perform integer division of a by b and get the remainder, which syntax is correct?

a)

a mod b

b)

a % b

c)

a / b

d)

a \ b

18.

To perform integer division of a by b and get the integer part, which syntax is correct?

a)

a \ b

b)

int (a / b)

c)

a / b

d)

a div b

19.

To declare a constant in VB.Net, which syntax is correct?

a)

Const As =

b)

Const =

c)

Private =

d)

Dim =

20.

In VB.Net, to access the third element of array A, which syntax is correct?

a)

A(2)

b)

A[3]

c)

A[2]

d)

All are incorrect.

21.

The function to convert a string variable Str from date string type to date data type is?

a)

CDATE(Str)

b)

Date(Str)

c)

Convert.ToDate(Str)

d)

ConverDATE(Str)

22.

To convert a string variable containing numeric characters to an integer type, which function should be used?

a)

cint()

b)

change integer()

c)

chr()

d)

asc()

23.

In the For statement, if the Next keyword is omitted, what happens?

a)

The For statement is incorrect.

b)

It does not affect the statement, each iteration increases by 1.

c)

The statement is always considered correct (infinite loop).

d)

The loop is infinite.

24.

Which structure has a defined number of iterations?

a)

For … Next

b)

Do while…Loop

c)

Do until….Loop

d)

Do…Loop until

25.

In the Do Loop while (condition), how many times does the inner block execute?

a)

At least 1 time.

b)

At most 1 time.

c)

At least 0 times.

d)

All are correct.

26.

Declare an array as follows: Dim A As Integer() = New Integer(4). How many elements does array A have?

a)

5

b)

3

c)

1

d)

Another value.

27.

What is the result of the following program when run with n = 20?

a)

good3

b)

good1

c)

good2

d)

The program reports an error

28.

What is the result of the following program after running the code?

a)

All answers are incorrect.

b)

One

c)

Two

d)

Three

29.

How many times does the following For loop execute?

4 lines
30.

What does the following program do? X = " " 'empty string For Each varX In Array("one", "two", "three") X = X + varX Next Print X

a)

All answers are wrong.

b)

One

c)

Two

d)

Three

31.

How many times does the following For loop execute? Sub Main() Dim Array As String() = New String(2) {"one", "two", "three"} Dim X As String X = " " For Each varX In Array X = X + varX Next Console.WriteLine(X) Console.ReadLine() End Sub

a)

3 times.

b)

1 time.

c)

2 times.

d)

4 times.

32.

What will the following program output? Dim x, y, m As Integer x = 1 : m = 0 While x <= 5 y = x ^ 2 : Console.WriteLine(y) m = m + y : x = x + 1 End While

a)

1 4 9 16 25

b)

2 4 6 8 10

c)

1 4 6 9 25

d)

3 4 5 6 72

33.

What will the following program output? Dim x, y, m As Integer x = 1 : m = 0 While x <= 5 x = x + 1 : y = x ^ 2 Console.Write(y.ToString & " ") m = m + y End While

a)

4 6 9 16 25 36

b)

1 4 9 16 25

c)

2 4 6 8 10

d)

3 4 5 6 72

34.

What does the following program do? Dim x As Integer, y As Integer For x = 1 To 9 For y = 1 To 9 If x + y = 10 Then Console.WriteLine(x * 10 + y) Exit For End If Next y Next x

a)

Prints two-digit numbers whose digits sum to 10.

b)

Prints all numbers from 1 to 99.

c)

Prints numbers from 10 to 99.

d)

All options a, b, c are wrong.

35.

What will the following command output? Sub Main() For i As Integer = 1 To 5 If i = 3 Then Continue For Console.Write(" {0} ", i) Next Console.ReadLine() End Sub

a)

1 2 4 5

b)

1 2 3 4 5

c)

1 4 5

d)

0 1 2 3 4 5

36.

What will the following command output? Sub Main() Dim i As Integer = 0 While i < 4 i += 1 If i = 2 Then Continue While Console.Write("{0} ", i) End While Console.ReadLine() End Sub

a)

1 3 4

b)

1 2 4

c)

1 2 3 4

d)

No correct answer.

37.

What will the following command output? Sub Main() Dim i As Integer = 1 Do Console.Write("{0} ", i) i += 1 If i = 2 Then Continue Do Loop While i < 4 Console.ReadLine() End Sub

a)

1 2 3

b)

1 2 4

c)

1 4

d)

1 2 3 4

38.

What will the following command output? Sub Main() Dim x As Integer = 20 Select Case x Case 10 Console.WriteLine("x = 10") Case 15 Console.WriteLine("x = 15") Case 20 Console.WriteLine("x = 20") Case Else Console.WriteLine("Undefined") End Select Console.ReadLine() End Sub

a)

x = 20

b)

x = 15

c)

x = 10

d)

Undefined.

39.

What will the following command output? Sub Main() Dim i As Integer Dim S As Integer = 0 For i = 1 To 20 Step 1 S = S + i Next Console.Write(" Total = " & S) Console.ReadLine() End Sub

a)

210

b)

200

c)

100

d)

No correct answer.

40.

What does the following code do? Sub Main() Dim i As Integer Dim S As Integer = 0 For i = 1 To 20 Step 1 S = S + i Next Console.Write(" Tong la = " & S) Console.ReadLine() End Sub

a)

210

b)

200

c)

100

d)

No correct answer.

41.

What does the following code do? Sub Main() Dim names As String() = New String(2) {" Nhom 2", " Nha Co ", " 4 chi em"} For Each name As String In names Console.WriteLine(name) Next Console.ReadLine() End Sub

a)

Prints the values in the string on 3 lines.

b)

Prints the values in the string on 1 line.

c)

Reports an error.

d)

Prints nothing.

42.

What does the following code do? Sub Main() Dim array As Integer() = New Integer(4) {8, 2, 3, 4, 9} For i As Integer = 0 To array.Length - 1 Console.WriteLine(array(i)) Next Console.ReadLine() End Sub

a)

Prints the elements of the array.

b)

Calculates the sum of the elements of the array.

c)

Inputs the elements of the array.

d)

Sorts the array in ascending order.

43.

What is the value of the variable counter after executing the following code? Sub Main() Dim counter As Integer counter = 1 Do Until counter > 5 counter = counter + 1 Loop MsgBox("Gia tri hien tai cua counter la: " & counter) End Sub

a)

6

b)

5

c)

1

d)

4

44.

For the following program, which statement is correct? Private Sub Doiso() Dim bytX As Byte, intY As Integer intY = 1234 bytX = intY End Sub

a)

The program will report an error when running (Run-time error).

b)

The program will report an error due to invalid variable declaration.

c)

The program will run successfully.

d)

All three answers above are incorrect.

45.

What will the following program output? Public Function AAA(ByVal x As Long) For i = 2 To x - 1 x = x * i Next AAA = x End Function Sub Main() Console.WriteLine("Ket qua : " & AAA(5)) Console.ReadLine() End Sub

a)

120

b)

5

c)

240

d)

The program reports an error.

46.

What is encapsulation?

a)

A mechanism that binds data and operations on that data into a single unit, preventing unexpected external effects. This unit is called an object.

b)

A mechanism that divides a program into functions and procedures that perform separate tasks.

c)

A mechanism that prevents other components from accessing its internals.

d)

A mechanism that shows a function can have multiple instances at different times.

47.

What is inheritance?

a)

The ability to build new classes from old classes, where the new class is called a derived class and the old class is called a base class.

b)

The ability to reuse previously built functions.

c)

The ability to reuse previously built data types.

d)

All are correct.

48.

What is polymorphism?

4 lines
49.

What is polymorphism?

a)

The ability of a message to change its representation based on the specific class of the object receiving the message.

b)

The ability of a message to be passed to its subclass.

c)

The ability of a function or procedure to be inherited.

d)

The ability of a function or procedure to be reused.

50.

What is an object class?

a)

A design or template for objects of the same type.

b)

A specific instance for objects.

c)

A set of elements of the same type.

d)

A set of values of the same type.

51.

In the following options, which option describes polymorphism?

a)

Classes Point, Circle, Square, Rectangle... all have a Draw method.

b)

Class Circle inherits from class Point.

c)

Class Square inherits from class Rectangle.

d)

Classes Point and Circle both have constructors and destructors.

52.

When declaring and building a class, what components must be clearly defined?

a)

Attributes (data) and methods (behavior) of the class.

b)

Data and objects of the class.

c)

Concepts and objects of the class.

d)

Countless components.

53.

For the following program segment: Class A Private x As Integer Public y As Integer End Class Sub Main() Dim obj1, obj2 As New A() obj1.x = 10 obj2.y = 8 End Sub At which line does the program have an error?

a)

Error at line obj1.x=10;

b)

Error at line obj1.y=8;

c)

Error at line Dim obj1,obj2 as A

d)

Error at line Private x As Integer

54.

For the following program segment: Class A Private x As Integer Public y As Integer End Class Sub Main() Dim obj1, obj2 As New A() obj1.x = 10 obj2.y = 8 End Sub The error at obj1.x=10. What is the cause of this error?

a)

Cannot access the private component of the class.

b)

x is not declared.

c)

Cannot determine the value of x.

d)

Must be called through the class name, not through the object name.

55.

What is a public component of a class?

a)

Allows access from both inside and outside the class and allows inheritance.

b)

Does not allow access from outside the class, only methods inside the class can access it.

c)

Does not allow access from outside the class but allows inherited classes to access it.

d)

Allows access from outside the class.

56.

When declaring properties and methods of a class with the keyword Dim, what is the access scope?

a)

private

b)

public

c)

protected

d)

The program will error and require one of the three keywords.

57.

What is a constructor in VB.Net?

a)

Has the name New, may or may not have arguments.

b)

Has the same name as the class.

c)

Can only build one constructor.

d)

Built inside h

58.

What is the result of the following code? Console.WriteLine(arr.x) after executing the method cal with item 2.

a)

4

b)

2

c)

0

d)

8

59.

How can you declare an array of 10 students in VB.Net?

a)

Dim mang(10) As SinhVien

b)

Dim mang[10] As SinhVien

c)

Cannot declare an array of objects

d)

SinhVien mang(10)

60.

What is the result when running the following code? p.f2() after creating a new Dog object.

a)

Error on line 'Implements Ianimals'

b)

Prints 'Dog'

c)

Error on line 'p.f2()'

d)

Prints nothing.

61.

What will be displayed if obj3.SomeMethod() is called?

a)

BaseClass definition

b)

DerivedClass definition

c)

Error.

d)

Prints nothing.

62.

How to declare inheritance in VB.Net?

4 lines
63.

What keyword is used to declare inheritance in VB.Net?

a)

inherits

b)

extends

c)

Use the :

d)

No correct answer.

64.

To declare a constructor with a default parameter b = 6 for a rectangle class created by two sides a, b, how should it be declared?

a)

Public Sub New(a As Integer, Optional b As Integer = 6)

b)

Public Sub New(Optional a As Integer, Optional b As Integer = 6)

c)

Public Sub New(a As Integer, b As Integer = 6)

d)

Public Sub New(Optional a As Integer= 6, b As Integer = 6)

65.

In the fraction class, what does the following method declaration mean? Public Sub New(Optional tu As Integer = 1, Optional mau As Integer = 3) Me.tu = tu Me.mau = mau End Sub

a)

Constructor with default parameters of the PhanSo class.

b)

Copy constructor of the PhanSo class.

c)

Assignment method of the PhanSo class.

d)

The declaration cannot exist in the PhanSo class.

66.

In the following program: Public Class PhanSo Private tu, mau As Integer Public Sub New(tu As Integer, mau As Integer) Me.tu = tu Me.mau = mau End Sub Public Sub Xuat() Console.WriteLine(a & '/' & b) End Sub End Class Sub Main() Dim ps1 As New PhanSo() ps.Xuat() End Sub, why does the declaration 'Dim ps1 As New PhanSo()' report an error?

a)

Calling the constructor without parameters while the program has not built it.

b)

The program cannot be wrong because VB.Net will automatically generate a parameterless constructor.

c)

Cannot determine which constructor to call.

d)

All are incorrect.

67.

A method in a subclass that has the same name and return type as a method in its superclass is called?

a)

Method overriding.

b)

Method overloading.

c)

Method hiding.

d)

Method shadowing.

68.

How to declare an abstract method?

a)

Public MustOverride Sub Sound()

b)

Public abstract Sub Sound()

c)

Public MustOverride Sub Sound()

d)

public Overrides Sub Sound()

69.

What is the output of the following code? Dim v As New Vehicle() Dim c As New Car() v.drive() c.drive() v = c v.drive()

a)

Vehicle: drive Car: drive Vehicle: drive

b)

Compile error at line v = c

c)

Runtime error at line v = c

d)

Vehicle: drive Car: drive Car: drive

70.

What is the output of the following code? Dim v As New Vehicle() Dim c As New Car() v.drive() c.drive() c = v c.drive()

a)

Runtime error at line v = c

b)

Vehicle: drive Car: drive Vehicle: drive

c)

Compile error at line v = c

d)

Vehicle: drive Car: drive Car: drive

71.

Which statement is false?

a)

An object of an abstract class can be instantiated.

b)

Any class containing an abstract method must be declared with the MustInherit keyword.

c)

An abstract class can contain one or more abstract methods.

d)

An abstract class can be inherited.

72.

What can multiple inheritance in VB.Net be achieved by?

a)

Interfaces.

b)

Multithreading.

c)

Abstract methods.

d)

Class.

73.

What is the output of the following code? Dim p As New Student() p.output()

a)

Meggies001

b)

Compile Error.

c)

Runtime Error.

d)

Nothing printed.

74.

Which statement about Interface is incorrect?

a)

A class cannot implement multiple interfaces.

b)

Interface is used to achieve multiple inheritance in VB.Net.

c)

An object of an interface cannot be instantiated.

d)

An interface can inherit multiple interfaces.

75.

Which statement is used to add a new item to ListBox?

a)

A. ListBox1.Items.Add("xin chao")

b)

B. ListBox1.AddNewItem("Xin chao")

c)

C. ListBox1.Items.AddNew("Xin chao")

d)

D. None of the answers are correct.

76.

What is the purpose of the Visible property of objects?

a)

A. To prevent moving controls

b)

B. To display images

c)

C. To allow text input

d)

D. To hide or show controls

77.

To make the image size fit the PictureBox, which property is used?

a)

A. SizeMode

b)

B. Image

c)

C. Size

d)

D. MaximumSize

78.

To allow the image size to fit the PictureBox, which property do we use?

a)

SizeMode

b)

Image

c)

Size

d)

MaximumSize

79.

Which control is used to group related information together?

a)

Form

b)

Panel

c)

Combobox

d)

GroupBox

80.

To delete the current image in the PictureBox object, which command do we use?

a)

PictureBox1.Image=null

b)

PictureBox1.Image= ""

c)

PictureBox1.FromFile=null

d)

None of the answers are correct

81.

Which object allows creating multiple working pages in a Form window?

a)

TreeView

b)

Listview

c)

TabControl

d)

Combobox

82.

Which object belongs to the Containers group on the toolbox?

a)

Combobox

b)

Listbox

c)

Panel

d)

Label

83.

The unselected line in the ListBox has what index value?

a)

-1

b)

0

c)

1

d)

Any value

84.

What is a ComboBox?

a)

It is a control that allows data entry and selection.

b)

It is a control that allows viewing information.

c)

It is a control similar to ListBox.

d)

None of the answers are correct

85.

How many types does a ComboBox have?

a)

1

b)

2

c)

3

d)

4

86.

Which control allows users to input date values in the required format?

a)

TextBox

b)

DateTimePicker

c)

ComboBox

d)

MonthCalendar

87.

Which control is used to select a date?

a)

DateTimePicker

b)

MonthCalendar

c)

None of the answers are correct

88.

The FirstDayOfWeek property of the MonthCalendar control has a default value of which day?

a)

Saturday

b)

Sunday

c)

Monday

d)

None of the answers are correct

89.

Which property allows changing the background color of the Panel control?

a)

BackColor

b)

BorderStyle

c)

BackGround

d)

None of the answers are correct

90.

Which statement is correct?

a)

Timer control is only for application developers.

b)

Timer control is invisible during runtime.

c)

Timer control triggers events at specific intervals.

d)

All answers are correct

91.

What can RichTextBox do?

a)

Display many types of documents with font formatting, images, document styles.

b)

Only display text and cannot format.

c)

Only used to display text and format font.

d)

Used to display images.

92.

What is the ProgressBar control?

a)

A control that allows displaying the progress of execution.

b)

A control that allows displaying a list of directories.

c)

A control for executing progress.

d)

A control that displays error messages of the program.

93.

How is the Name property of controls named?

a)

Names must not exceed 20 characters.

b)

Names must start with cmd, txt, lbl...

c)

Cannot contain spaces, written without accents.

94.

How should the Name property of controls be named?

a)

The name should not exceed 20 characters

b)

The name should start with cmd, txt, lbl...

c)

It should not contain spaces, use Vietnamese without accents, and no special characters

d)

It can be named freely as long as it has meaning

95.

Which control is used to create a directory tree?

a)

Timer control

b)

RichTextBox control

c)

TreeView control

d)

ProgressBar control

96.

To display the progress of execution, which control should be selected?

a)

RichTextBox control

b)

TreeView control

c)

ListView control

d)

ProgressBar control

97.

What does the command lstMyListView.items.Clear() do?

a)

Deletes all items in ListView.

b)

Deletes any item in ListView

c)

Selects an item and displays it in ListView

d)

No correct answer.

98.

What is a syntax error?

a)

This error occurs due to incorrect language structure

b)

Occurs unexpectedly while the program is running.

c)

An error due to incorrect thinking leading to wrong results

d)

An error caused by hardware

99.

How to handle syntax errors?

a)

This error can be caught by the code editor, the programmer corrects the syntax.

b)

Error trapping and using error handling structures

c)

Run the program multiple times with different results to see if it fits

d)

Delete the erroneous code and rewrite it

100.

Choose the best answer about the result of executing the following statements? Dim objListView as ListViewItem objListView = lstMyListView.Items.Add("Hi",0) objListView.SubItems.Add("Display")

a)

Add item

b)

Delete item

c)

Add item and subitem to ListView

d)

Select an item and display it in ListView

101.

The Enabled property of the Timer object set to True means?

a)

The Timer object is running

b)

The Timer object is not running

c)

Turn off the Timer object

d)

All answers are correct

102.

Which statement is correct about the timer object?

a)

Timer control is hidden during the application run.

b)

The timer object is visible during the run

c)

The visibility of the timer object is set by the programmer

103.

Which statement about RichTextBox is correct?

a)

RichTextBox is an extended TextBox

b)

RichTextBox is an area for text editing

c)

RichTextBox provides more formatting capabilities than TextBox

d)

All three answers are correct

104.

What does the following code do? If lstMyListView.selectedItems.Count > 0 Then MessageBox.Show (lstMyListView.selectedItems (0).Text) End If

a)

Add item

b)

Delete item

c)

Add item and subitem to ListView

d)

Select an item and display it in ListView

105.

What does the following code do? tvwLanguages.Nodes.clear()

4 lines
106.

What does the following code do? tvwLanguages.Nodes.clear()

a)

Clear all nodes in TreeView

b)

Delete selected node

c)

Add an object

d)

Edit nodes in TreeView

107.

Which control is commonly selected to execute a task?

a)

RichTextBox

b)

TreeView

c)

ListView

d)

Button

108.

Which property allows hiding/showing a control on the form when the program runs?

a)

Visible

b)

Enable

c)

Name

d)

Font

109.

Which method is used to display a Dialog?

a)

ShowDialog()

b)

DisplayDialog()

c)

Show()

d)

Display()

110.

Which control allows the user to check and open an existing file?

a)

OpenFileDialog

b)

SaveFileDialog

c)

FontDialog

d)

FolderBrowserDialog

111.

Which property of the SaveFileDialog control specifies whether to prompt the user to create a file if it does not exist?

a)

OverwrirePrompt

b)

CreatePrompt

c)

OpenPrompt

d)

Prmpt

112.

Which property of the ColorDialog control displays all basic color dialog boxes?

a)

ShowColor

b)

CustomColors

c)

Color

d)

AnyColor

113.

What is the correct syntax for displaying a message?

a)

MessageBox.Show("Hi there", "Hi")

b)

MessageBox.Show(Hi there, Hi)

c)

MessageBox.Show "Hi There", "Hi"

d)

MessageBox.Show Hi There, Hi

114.

Which statement is used to disable the mnuFilePrint object?

a)

mnuFilePrint.Disabled = True

b)

mnuFilePrint.Enabled = False

c)

mnuFilePrint.Available = False

d)

Disable mnuFilePrint

115.

Which property determines the type of file displayed in the Open or Save As dialog?

a)

FileTypes

b)

Filter

c)

Types

d)

FileDisplay

116.

When a user selects a file in the Open or Save As dialog, where is the file path and name stored?

a)

Filename

b)

PathName

c)

File

d)

Item

117.

Which property initializes the first directory path when opening the Open or Save As dialog?

a)

InitialDirectory

b)

InitialFolder

c)

Location

d)

Path

118.

How many menus can be created in VB.Net?

a)

10

b)

7

c)

11

d)

8

119.

How many types of Dialog are there in the Dialog Category in the Toolbox?

a)

3

b)

5

c)

7

d)

4

120.

Which control in the Toolbox is used to create menus on Windows Form?

a)

Menu control

b)

Menu Strip control

c)

Form control

d)

Menu properties

121.

The list of items displayed in each menu is called:

a)

Items

b)

Menu list

c)

Menu items

d)

Lists

122.

Which property is used by the programmer to reference each menu in the code?

a)

Text

b)

Code

c)

Name

d)

Element

123.

Each Menu Title will have a unique (a)   ?

124.

Which property is used by programmers to reference each menu in the code?

a)

Text

b)

Code

c)

Name

d)

Element

125.

Each Menu Title will have a unique ________________?

a)

Access key

b)

Property

c)

Caption

126.

What are the 2 controls needed when creating a toolbar?

a)

Only toolbar control

b)

ImageList and Toolbar Control

c)

Both A and B

d)

All of the above

127.

SqlConnection is an object used to?

a)

Create a connection to the database on SQL Server

b)

Execute a query

c)

Read the returned data

d)

Create a connection to the Access database

128.

To fill data into the dataGridView control, you declare the statement

a)

dataGridView1.DataSource = data source

b)

dataGridView1.DataMember = data source

c)

dataGridView1.RowSource = data source

d)

None of the answers are correct

129.

What parameters do we need when initializing an object of the SqlConnection class?

a)

server; database, integrated security

b)

server; password; database

c)

database; integrated security; password

d)

server; database; username

130.

To execute Insert statements, which method do we use in VB.NET?

a)

ExecuteNonQuery()

b)

ExecuteReader()

c)

ExecuteScalar()

d)

EndExecuteNonQuery()

131.

To execute a Select query, which statement do we use?

a)

ExecuteReader()

b)

ExecuteNonQuery()

c)

ExecuteScalar()

d)

EndExecuteReader()

132.

Which line is incorrect in the following statement?

a)

Dim ketnoi = new SqlConnection(@server=(local);database=Quanlysinhvien; integrated security=true;);

b)

Dim truyvan = select * from sinhvien;

c)

Dim cmd = new SqlCommand(ketnoi);

d)

Dim da = new SqlDataAdapter(cmd);

133.

Which line is incorrect in the following statement?

a)

Dim ketnoi = new SqlConnection(@server=(local);database=Quanlysinhvien; integrated security=true;)

b)

Dim truyvan = select * from sinhvien

c)

Dim cmd = new SqlCommand(truyvan,ketnoi)

d)

cmd.ExecuteNonQuery()

134.

Which line is incorrect in the following statement?

a)

Dim ketnoi = new SqlConnection(@server=(local);database=Quanlysinhvien; integrated security=true;)

b)

Dim truyvan = delete from sinhvien

c)

Dim cmd = new SqlCommand(truyvan,ketnoi)

d)

cmd.ExecuteReader()

135.

To use SqlConnection and SqlCommand objects, which library must you declare?

a)

Imports System.Data.SqlClient

b)

Imports System.Data

c)

Imports System.Data.SqlClient.Data

d)

Imports System.Data.OLEDB

136.

To open a connection to the Server, which method do we use?

(a)  

137.

Which library do we import?

a)

Imports System.Data.SqlClient

b)

Imports System.Data

c)

Imports System.Data.SqlClient.Data

d)

Imports System.Data. OLEDB

138.

To open a connection to the Server, which method do we use?

a)

ketnoi.Open()

b)

ketnoi.OpenConnection()

c)

ketnoi.OpenDatabase()

d)

None of the answers are correct

139.

To get the current row index in DataGridView, which command do we use?

a)

dataGridView1.CurrentRow.Index

b)

dataGridView1.CurrentCell.Index

c)

dataGridView1.CurrentRow.Count

d)

None of the answers are correct

140.

To get the value of the currently selected cell (the current row is the first row), which command do you choose in dataGridView?

a)

DataGridView1.CurrentRow.Cells(0).Value

b)

dataGridView1.CurrentRow.Cells[0].Text

c)

dataGridView1.CurrentCell.Row[0].Value

d)

dataGridView1.CurrentRow.Row[0].Value

141.

To get the value of the second column in the third row in dataGridView, which command do you choose?

a)

dataGridView1.Rows[2].Cells(1).Value

b)

dataGridView1.CurrentRow[2].Cells[1].Value

c)

dataGridView1.Cells[2].Rows[1].Value

d)

None of the answers are correct

142.

What does the following code do? dataGridView1.Rows(current).Selected = false current = 0 dataGridView1.Rows(current).Selected = true

a)

Moves to the first record

b)

Moves to the last record

c)

Moves to the record behind the current record

d)

Moves to the record in front of the current record

143.

What does the following code do? if current >dataGridView1.Rows.Count-1 then return end if dataGridView1.Rows(current).Selected = false current = current + 1 dataGridView1.Rows(current).Selected = true

a)

Moves to the record after the current record

b)

Moves to the first record

c)

Moves to the record in front of the current record

d)

Moves to the last record

144.

What does the following code do? if current <= 0 then return end if dataGridView1.Rows(current).Selected = false current = current-1 dataGridView1.Rows(current).Selected = true

a)

Moves to the record before the current record

b)

Moves to the last record

c)

Moves to the record behind the current record

d)

Moves to the first record

145.

What does the following code do? if dataGridView1.Rows(current).IsNewRow then return end if

4 lines