Você está na página 1de 5

TRƯỜNG ĐẠI HỌC CÔNG NGHỆ THÔNG TIN

ĐỀ THI MÔN LẬP TRÌNH CƠ SỞ DỮ LIỆU


Đề số 1
Thời gian làm bài: 120 phút
(Đề thi gồm 3 trang - Học viên được phép tham khảo tài liệu)

A. PHẦN CÂU HỎI TRẮC NGHIỆM (5 điểm, 20 câu)

1
TRƯỜNG ĐẠI HỌC CÔNG NGHỆ THÔNG TIN

1) What is the out put ? End Sub


NotInheritable Class A
Public sub printA A. 2
End sub B. 5
Public sub PrintB C. 8
End sub D. 7
End Class
5) DataSet - Which one of the following is TRUE
Class B Inherits A ?
End Class AcceptChanges Method of DataSet will commit
the followings.
A. Both PrintA & PrintB are available at Class B
B. Only PrintA is available at Class B A. Schema or Structural changes only
C. Class B Can not inherit classA as it is not B. DataRow related changes Only
inheritable C. A & B
D. None of above D. None of above

2) Which keyword refers the parent of the 6) Which namespace Provides access to the
current object database classes:
A. Me
B. Super A. System.Database
C. Mybase B. System.DataAdapter
D. This C. System.Data
D. None of above
3) What will be the result of the following
code ? 7) which program will you use to assemble a
Dim X As String = "ABCDEF" program written in IL:
Dim Y As String = "BC" A. ilasm
Console.WriteLine("{0}, {1}, {2}", (X = Y), (X B. ildasm
< Y), (X > Y)) C. clr
D. None of above
A. False, False, True
B. False, False, False 8) How do you create method which can be
C. False, True, False accessed without the use of objects
D. True, False, False reference ?
A. Using FRIEND Keyword
4) At the end of the Main sub below, what is the B. Using STATIC Keyword
value of x.value? C. Using SHARED Keyword
Public Class Class1 D. NONE
Public N As String
Public V As Integer 9) Which of the following are the valid method of
Sub New(ByVal N As String, ByVal V command object
As Integer) A. ExecuteNonQuery & ExecuteScalar
Me.N = N B. ExecuteQuery & ExecuteScalar
Me.V = V C. ExecuteParameter
End Sub D. None
End Class
10) What are the sequence of events of a
Sub Main() webForm Life Cycle
Dim X As New Class1("FF", 3) A. Form_Initialize, Form_Load,
X.V = 2 Form_FormClosing, Form_FormClosed
Dim Y As Class1 = X
Dim Z As New Class1("AA", 5) B. Form_Load, Form_Initialize,
Y.V = 8 Form_FormClosing, Form_FormClosed
Z.V = 7
Console.WriteLine (X.V)

2
TRƯỜNG ĐẠI HỌC CÔNG NGHỆ THÔNG TIN

C. Form_Initialize, Form_Load, B. Option Strict


Form_FormClosed, Form_FormClosing C. Option All
D. None of the Above
D. Form_Load, Form_Initialize,
Form_FormClosed, Form_FormClosing
15) Parameters to methods in VB.NET are
declared by default as
11) How do you join strings in VB.NET
A. ByVal
A. +
B. ByRef
B. &
C. Both A and B
C. Both A & B
D. None of the Above
D. None of above
16) Dataset is always disconnected
12) Classes from which namespace will have
A. True
to be used to read or write to a file?
B. False
A. System.IO
B. System.FileObjects
17) What is the difference between class
C. System.FileSystem
module and code module
D. None of above
A. Code modules are instantiated at runtime
and class modules are instantiated at the
13) What is the output of the following code
time of design
Class _Myclass
B. Class modules are instantiated at runtime
Public Shared num as integer
to create objects and code modules do not
Public Sub New (I as integer)
have instances
num=i
C. Both A & B
End sub
D. None
Public sub New()
End sub
18) Which of the following denote gateway to
End Class
the database?
A. Data links
Module Module1
B. Connection objects
Sub Main()
C. Both A and B
Dim Cls1 as New _Myclass (100)
D. None of the Above
Dim Cls2 as New _Myclass
Console.Writeline (Cls2.num)
19) Constants are declared using the
End Sub
keyword
End Module
A. Constant
B. Const
A. Prints 0
C. Consta
B. Prints 1
D. Fixed
C. Prints 100
D. Prints Null
20) In VB.NET a 16-bit integer is known as
A. Integer
14) Which of the following when turned on do
B. Short
not allow incompatible type conversion?
C. Long
A. Option Explicit
D. None of the Above

3
TRƯỜNG ĐẠI HỌC CÔNG NGHỆ THÔNG TIN

B. PHẦN THI VIẾT (5 điểm)


Mô tả bài toán quản lý quán café như sau:
Một quán café có bán các loại thức uống, món ăn, giá các món ăn, thức uống có thể thay đổi
trong khoảng thời gian. Người quản lý quán muốn quản lý thu nhập hàng ngày của quán để
làm cơ sở tính thu nhập, tính lương và thưởng cho nhân viên.
Mỗi bàn có một nhân viên phục vụ chính (khi khách vào, nhân viên nào rảnh sẽ được chỉ định
phục vụ chính cho bàn đó), có một mã số, số chỗ ngồi. Khách hàng có thể gọi thức uống, món
ăn và được nhân viên phục vụ chính ghi nhận lại trên phiếu, chuyển phiếu đến bộ phận quản
lý và bộ phận phục vụ thức uống, món ăn. Bộ phận quản lý sẽ chuyển dữ liệu này cho nhân
viên thu ngân nhập liệu sau đó.
Khách hàng có thể gọi món mới, thay đổi món, số lượng. Khi khách gọi tính tiền thì nhân
viên thu ngân sẽ in hóa đơn tính tiền và nhân viên phục vụ thu tiền.
Cuối ngày người quản lý có thể xem các báo cáo thống kê số lượng bán và doanh thu các loại
(từng món, theo bàn, theo nhân viên) theo từng ngày, từng tuần cũng như từng tháng hoặc
một khoảng thời gian để nắm được tình hình lợi nhuận của quán.
1). Phân tích các loại báo biểu cho bài toán ứng dụng này (2 điểm).
2). Hãy chọn (tùy ý) một báo biểu có tham số trong các loại báo biểu phân tích ở câu 1 (ví dụ
tham số của báo biểu là năm cần thống kê dữ liệu: 1996, như hình bên dưới).
Yêu cầu: thiết kế Form báo biểu, mô tả báo biểu (gồm những Section gì, field nằm trong
Section nào…) và viết lệnh cài đặt cho báo biểu đã chọn. Lưu ý: có thể đặt tên connection là
Connection1, tên đối tượng ReportDocument là ReportDocument1, tên đối tượng
OleDBDataAdapter là OleDBDataAdapter1, tên đối tượng CrystalReportViewer là
CrystalReportViewer1,…(3 điểm).

4
TRƯỜNG ĐẠI HỌC CÔNG NGHỆ THÔNG TIN

Você também pode gostar