一、单选题(共15小题,每题2分,满分30分)
1. 关于C#语言的基本语法,下列哪些说法是正确的?(     )
(A) C#语言使用using 关键字来引用.NET 预定义的命名空间
(B) 用C#编写的程序中,Main 函数是唯一允许的全局函数
(C) C#语言中使用的名称不区分大小写
(D) C#中一条语句必须写在一行内
2. 在C#中,表示一个字符串的变量应使用以下哪条语句定义?(     )
(A) CString str;   (B) string str;
(C) Dim str as string; (D) char * str;
3. 在C#中,新建一字符串变量str,并将字符串“Tom's Living Room”保存到串中,则应该使用下列哪条语句?(     )
(A) string str = “Tom\'s Living Room”
(B) string str = “Tom's Living Room”
(C) string str(“Tom's Living Room”)    
(D) string str(“Tom”s Living Room”)
4. 在C#语言中,执行完  a=5%3 语句后,a的值为(     )。
(A) 0 (B) 2 (C) 3 (D) 5
5. C#可执行程序的主入口点是(     )。
(A) main函数 (B) Main函数 (C) Run函数 (D) Form_Load函数
6. 用在方法的定义处,以指明该方法不返回任何值的关键字是(     )。
(A) static (B) string (C) void   (D) public
7. 可用作C#程序用户标识符的一组标识符是(     )。
(A) void    define    +WORD (B) a3_b3    _123     YN
(C) for      -abc      Case (D) 2a      DO      sizeof
8. 以下不属于C#提供的简单数据类型的是(     )。
(A) 整型 (B) 指针类型 (C) 布尔型 (D) 实型
9. 修饰符(     )是表示公有成员,允许从外部进行访问类的公有成员,这是限制最少的一种访问方式。
(A) public (B) private (C) protected (D) internal
10. 以下进行数组定义和初始化的方法错误的是(     )。
(A) int[]arr; arr= {1,2,3,4,5}; (B) int[]arr = {1,2,3,4,5};
(C) arr={1,2,3,4,5}; (D) int[]arr =new int[5];
11. 以下不属于函数调用方法的是(     )。
(A) 在单行语句中调用   (B) 在表达式中调用
(C) 作为参数调用 (D) 函数重载
12. 窗体的默认事件是(     )。
(A) Click (B) Keyup (C) DoubleClick (D) Load
13. (     )属性用于设置控件是否可用。
(A) Visible (B) Enabled (C) BackColor (D) ForeColor
14. 以下不属于组合框ComboBox的风格的是(     )。
(A) 简单组合框   (B) 下拉式组合框
(C) 下拉式列表框 (D) 简单列表框
15. 以下(     )组件用于打开一个“字体”对话框。
(A) ColorDialog (B) OpenFileDialog
(C) SaveFileDialog (D) FontDialog三、程序阅读题(共5小题,每题5分,满分25分)
1. 以下程序的运行结果为_______。
class Program
{
    static void Main(string[] args)
    {
       int x = 5;
       int y = x++;
       Console.WriteLine(y);
       y = ++x;
       Console.WriteLine(y);
       Console.ReadLine();
    }
}2. 以下程序的运行结果为_______。
class Program
{
    static void Main(string[] args)
    {
       int[ ] a ={2,4,6,8,10,12,14,16,18};
       for (int i=0; i<9; i++) {
          Console.Write(" "+a[i]);
          if ((i+1)%3==0) Console.WriteLine();
       }
   Console.ReadLine();
}
}3. 以下程序的运行结果为_______。
class Program
{
static void Main(string[] args)
{
      int s=0,i;
      for (i=1; ; i++) {
          if (s>50)  break;
          if (i%2==0)  s+=i;
       }
       Console.WriteLine ("i=" + i + ",s=" + s);
       Console.ReadLine();
   }
}4. 以下程序的运行结果为_______。
class Program
 {
    static void LE(ref int a, ref int b)
    {
        int x = a;
        a = b;
        b = x; 
     }    static void Main(string[] args)
    {
       int x=10, y=25;
       Console.WriteLine(x + "," + y);
       LE(ref x, ref y); 
       Console.WriteLine (x + "," +y);
       Console.ReadLine();
}
}5. 以下程序的运行功能为_______。
class Program
 {
     static void Main(string[] args)
     {
        float y = 0, n = 0;
        int x = Convert.ToInt32(Console.ReadLine()); 
        while (x != -1)
        {
           n++; 
y += x;
           x = Convert.ToInt32(Console.ReadLine());
        }
        if (n == 0)
            Console.WriteLine(y);
        else
            Console.WriteLine(y/n);
        Console.ReadLine();
     }
}                     
图1 简易计算器