姓名:_____________ 学校:_____________________ 专业:______________________ 学历:__________ 联系方式:______________ E-mail:__________________________ 考试时间:________________________
试卷:____________________________ 满分100分 共20题
阅卷时间:________ 阅卷人:_________ 对___题 错___题 成绩:______________
一.选择题(中文)
1. C#的数据类型有( )
a) 值类型和调用类型;
b) 值类型和引用类型;
c) 引用类型和关系类型;
d) 关系类型和调用类型;
2. int[ ][ ] myArray3=new int[3][ ]{new int[3]{5,6,2},new int[5]{6,9,7,8,3},new int[2]{3,2}}; myArray3[2][2]
的值是( )。
a) 9
b) 2
c) 6
d) 越界
3.以下的C#代码,试图用来定义一个接口:
public interface IFile
{
int A;
int delFile()
{
A = 3;
}
void disFile();
}
关于以上的代码,以下描述错误的是()。
a) 以上的代码中存在的错误包括:不能在接口中定义变量,所以int A代码行将出现错误;
b) 以上的代码中存在的错误包括:接口方法delFile是不允许实现的,所以不能编写具体的实现函数; c) 代码void disFile();声明无错误,接口可以没有返回值;
d) 代码void disFile();应该编写为void disFile(){};
4.下列描述错误的是()
a) 类不可以多重继承而接口可以;
b) 抽象类自身可以定义成员而接口不可以;
c) 抽象类和接口都不能被实例化;
d) 一个类可以有多个基类和多个基接口;
5.接口是一种引用类型,在接口中可以声明(),但不可以声明公有的域或私有的成员变量。
a) 方法、属性、索引器和事件;
b) 方法、属性信息、属性;
c) 索引器和字段;
d) 事件和字段;
二.选择题(英文)
6.You use Visual Studio .NET to develop a Windows-based application. Your application will display customer order information from a Microsoft SQL Server database. The orders will be displayed on a Windows Form that includes a DataGrid control named DataGrid1. DataGrid1 is bound to a DataView object. Users will be able to edit order information directly in DataGrid1. You must give users the option of displaying only edited customer orders and updated values in DataGrid1. What should you do?
A: Set the RowStateFilter property of the DataView object to
DataViewRowState.ModifiedOriginal.
B: Set the RowStateFilter property of the DataView object to
DataViewRowState.ModifiedCurrent.
C: Set the RowFilter property of the DataView object to DataViewRowState.ModifiedOriginal. D: Set the RowFilter property of the DataView object to DataViewRowState.ModifiedCurrent.
7.Another developer in your company uses Visual Studio .NET to create a component named MyComponent. You deploy MyComponent to a server. When you execute MyComponent, you receive the following error message: "System.Security.Policy.PolicyException: Failed to
acquire required permissions." As quickly as possible, you need to discover which permissions are required by MyComponent. What should you do?
A: Request the source code from the developer who created MyComponent. Examine the source code to find the required
permissions.
B: Run the Microsoft CLR Debugger (DbgCLR.exe) on the server to view the permissions requested by the application at run time.
C: Run the Runtime Debugger (Cordbg.exe) on the server to view the permissions requested by the application at run time.
D: Run the Permissions View tool (Permview.exe) on the server to view the permissions required by MyComponent.
E: Run the MSIL Disassembler (Ildasm.exe) on the server to view permission requests by MyComponent that were denied.
8.You use Visual Studio .NET to create an application. Your application contains two classes, Region and City, which are defined in the following code segment. (Line numbers are included for reference only.)
01 public class Region {
02 public virtual void CalculateTax() {
03 // Code to calculate tax goes here.
04 }
05 }
06 public class City:Region {
07 public override void CalculateTax() {
08 // Insert new code.
09 }
10 }
You need to add code to the CalculateTax method of the City class to call the CalculateTax method of the Region class. Which code segment should you add on line 08?
A: CalculateTax();
B: this.CalculateTax();
C: base.CalculateTax();
D: Region r = new Region();
r.CalculateTax();
9.You use Visual Studio .NET to create an application that uses an assembly. The assembly will reside on the client computer when the application is installed. You must ensure that any future applications installed on the same computer can access the assembly. Which two actions should you take? (Each correct answer presents part of the solution. Choose two.)
A:Use XCOPY to install the assembly in the global assembly cache.
B:Use XCOPY to install the assembly in the Windows\Assembly folder.
C:Create a strong name for the assembly.
D:Precompile the assembly by using the Native Image Generator (Ngen.exe).
E:Modify the application configuration file to include the assembly.
F:Use a deployment project to install the assembly in the global assembly cache.
G:Use a deployment project to install the assembly in the Windows\System32 folder.
10.You use Visual Studio .NET to create a component named Request. This component includes a method named AcceptRequest, which tries to process new user requests for services. AcceptRequest calls a private function named Validate.
You must ensure that any exceptions encountered by Validate are bubbled up to the parent form of Request. The parent form will then be responsible for handling the exceptions. You want to accomplish this goal by writing the minimum amount of code.
What should you do?
A: Use the following code segment in AcceptRequest:
this.Validate();
B: Use the following code segment in AcceptRequest:
try {
this.Validate();
}
catch(Exception ex) {
throw ex;
}
C: Use the following code segment in AcceptRequest:
try {
this.Validate();
}
catch(Exception ex) {
throw new Exception("Exception in AcceptRequest", ex);
}
D: Create a custom Exception class named RequestException by using the following code segment:
public class RequestException:ApplicationException {
public RequestException():base() {
}
public RequestException
(string message):base(message) {
}
public RequestException(string message,
Exception inner):base(message, inner) {
}
In addition, use the following code segment in AcceptRequest:
try {
this.Validate();
}
catch(Exception ex) {
throw new RequestException("Exception in
AcceptRequest", ex);
}
三.简答题:
11:.NET中主要有那几种类型的控件,各有什么区别?列举一些常用控件的属性和事件?
12:.NET中主要的类库有那些,以及在实际中的使用方向?
13:介绍 ADO.NET中几个数据库处理的核心对象,以及各自的优缺点。
14:try {}里有一个return语句,那么紧跟在这个try后的finally {}里的code会不会被执行,什么时候被执行,在return前还是后?
15:C#中主要有那几种循环语句,相互之间的区别?
16:软件开发过程一般有几个阶段?每个阶段的作用?
四.数据库
产品表 (主键 ProductID)
ProductID 产品名 单价
1 name1 110
2 name2 220
3 name3 330
4 name4 440
销售计划表(主键 ProductID+客户名 外键:ProductID )
ProductID 客户名 订货数量 销售单价
2 m 2 250
1 n 3 110
3 n 1 300
4 m 2 400
17.是否能删除产品表中的name2?请说明理由与过程。
18.将销售计划表中m客户的产品名为name2的销售单价更换为产品表中相应的单价。
19.求销售计划表中各客户各自的销售总金额的sql语句。
20.求客户中销售总量最大的销售总金额的客户的sql语句
姓名:_____________ 学校:_____________________ 专业:______________________ 学历:__________ 联系方式:______________ E-mail:__________________________ 考试时间:________________________
试卷:____________________________ 满分100分 共20题
阅卷时间:________ 阅卷人:_________ 对___题 错___题 成绩:______________
一.选择题(中文)
1. C#的数据类型有( )
a) 值类型和调用类型;
b) 值类型和引用类型;
c) 引用类型和关系类型;
d) 关系类型和调用类型;
2. int[ ][ ] myArray3=new int[3][ ]{new int[3]{5,6,2},new int[5]{6,9,7,8,3},new int[2]{3,2}}; myArray3[2][2]
的值是( )。
a) 9
b) 2
c) 6
d) 越界
3.以下的C#代码,试图用来定义一个接口:
public interface IFile
{
int A;
int delFile()
{
A = 3;
}
void disFile();
}
关于以上的代码,以下描述错误的是()。
a) 以上的代码中存在的错误包括:不能在接口中定义变量,所以int A代码行将出现错误;
b) 以上的代码中存在的错误包括:接口方法delFile是不允许实现的,所以不能编写具体的实现函数; c) 代码void disFile();声明无错误,接口可以没有返回值;
d) 代码void disFile();应该编写为void disFile(){};
4.下列描述错误的是()
a) 类不可以多重继承而接口可以;
b) 抽象类自身可以定义成员而接口不可以;
c) 抽象类和接口都不能被实例化;
d) 一个类可以有多个基类和多个基接口;
5.接口是一种引用类型,在接口中可以声明(),但不可以声明公有的域或私有的成员变量。
a) 方法、属性、索引器和事件;
b) 方法、属性信息、属性;
c) 索引器和字段;
d) 事件和字段;
二.选择题(英文)
6.You use Visual Studio .NET to develop a Windows-based application. Your application will display customer order information from a Microsoft SQL Server database. The orders will be displayed on a Windows Form that includes a DataGrid control named DataGrid1. DataGrid1 is bound to a DataView object. Users will be able to edit order information directly in DataGrid1. You must give users the option of displaying only edited customer orders and updated values in DataGrid1. What should you do?
A: Set the RowStateFilter property of the DataView object to
DataViewRowState.ModifiedOriginal.
B: Set the RowStateFilter property of the DataView object to
DataViewRowState.ModifiedCurrent.
C: Set the RowFilter property of the DataView object to DataViewRowState.ModifiedOriginal. D: Set the RowFilter property of the DataView object to DataViewRowState.ModifiedCurrent.
7.Another developer in your company uses Visual Studio .NET to create a component named MyComponent. You deploy MyComponent to a server. When you execute MyComponent, you receive the following error message: "System.Security.Policy.PolicyException: Failed to
acquire required permissions." As quickly as possible, you need to discover which permissions are required by MyComponent. What should you do?
A: Request the source code from the developer who created MyComponent. Examine the source code to find the required
permissions.
B: Run the Microsoft CLR Debugger (DbgCLR.exe) on the server to view the permissions requested by the application at run time.
C: Run the Runtime Debugger (Cordbg.exe) on the server to view the permissions requested by the application at run time.
D: Run the Permissions View tool (Permview.exe) on the server to view the permissions required by MyComponent.
E: Run the MSIL Disassembler (Ildasm.exe) on the server to view permission requests by MyComponent that were denied.
8.You use Visual Studio .NET to create an application. Your application contains two classes, Region and City, which are defined in the following code segment. (Line numbers are included for reference only.)
01 public class Region {
02 public virtual void CalculateTax() {
03 // Code to calculate tax goes here.
04 }
05 }
06 public class City:Region {
07 public override void CalculateTax() {
08 // Insert new code.
09 }
10 }
You need to add code to the CalculateTax method of the City class to call the CalculateTax method of the Region class. Which code segment should you add on line 08?
A: CalculateTax();
B: this.CalculateTax();
C: base.CalculateTax();
D: Region r = new Region();
r.CalculateTax();
9.You use Visual Studio .NET to create an application that uses an assembly. The assembly will reside on the client computer when the application is installed. You must ensure that any future applications installed on the same computer can access the assembly. Which two actions should you take? (Each correct answer presents part of the solution. Choose two.)
A:Use XCOPY to install the assembly in the global assembly cache.
B:Use XCOPY to install the assembly in the Windows\Assembly folder.
C:Create a strong name for the assembly.
D:Precompile the assembly by using the Native Image Generator (Ngen.exe).
E:Modify the application configuration file to include the assembly.
F:Use a deployment project to install the assembly in the global assembly cache.
G:Use a deployment project to install the assembly in the Windows\System32 folder.
10.You use Visual Studio .NET to create a component named Request. This component includes a method named AcceptRequest, which tries to process new user requests for services. AcceptRequest calls a private function named Validate.
You must ensure that any exceptions encountered by Validate are bubbled up to the parent form of Request. The parent form will then be responsible for handling the exceptions. You want to accomplish this goal by writing the minimum amount of code.
What should you do?
A: Use the following code segment in AcceptRequest:
this.Validate();
B: Use the following code segment in AcceptRequest:
try {
this.Validate();
}
catch(Exception ex) {
throw ex;
}
C: Use the following code segment in AcceptRequest:
try {
this.Validate();
}
catch(Exception ex) {
throw new Exception("Exception in AcceptRequest", ex);
}
D: Create a custom Exception class named RequestException by using the following code segment:
public class RequestException:ApplicationException {
public RequestException():base() {
}
public RequestException
(string message):base(message) {
}
public RequestException(string message,
Exception inner):base(message, inner) {
}
In addition, use the following code segment in AcceptRequest:
try {
this.Validate();
}
catch(Exception ex) {
throw new RequestException("Exception in
AcceptRequest", ex);
}
三.简答题:
11:.NET中主要有那几种类型的控件,各有什么区别?列举一些常用控件的属性和事件?
12:.NET中主要的类库有那些,以及在实际中的使用方向?
13:介绍 ADO.NET中几个数据库处理的核心对象,以及各自的优缺点。
14:try {}里有一个return语句,那么紧跟在这个try后的finally {}里的code会不会被执行,什么时候被执行,在return前还是后?
15:C#中主要有那几种循环语句,相互之间的区别?
16:软件开发过程一般有几个阶段?每个阶段的作用?
四.数据库
产品表 (主键 ProductID)
ProductID 产品名 单价
1 name1 110
2 name2 220
3 name3 330
4 name4 440
销售计划表(主键 ProductID+客户名 外键:ProductID )
ProductID 客户名 订货数量 销售单价
2 m 2 250
1 n 3 110
3 n 1 300
4 m 2 400
17.是否能删除产品表中的name2?请说明理由与过程。
18.将销售计划表中m客户的产品名为name2的销售单价更换为产品表中相应的单价。
19.求销售计划表中各客户各自的销售总金额的sql语句。
20.求客户中销售总量最大的销售总金额的客户的sql语句