文档介绍:2020-2021《C#程序设计语言》期末课程考试试卷B
题号
一
二
三
四
总分
评卷教师
分数
说明:本试卷共四大题,试卷满分100分,考试时间120分钟。
判断题(每题2分,共10分,该对象:
TestClass obj二new TestClass ();
那么,可通过什么方式访问类TestClass的Property属性()
A. MyClass. Progerty; :: Property;
C. obj. Property; D. obj. Property();
下列关于继承说法中,哪个选项是正确的?()
继承是指派生类可以获取其基类特征的能力
继承最主要的优点是提高代码性能
派生类可以继承多个基类的方法和属性
派生类必须通过base关键字调用基类的构造函数
分析下列程序代码:
using System;
class Program
{
static void Main(string[] args)
{
string testString ="Visual Studio 2005〃;
string newString = string. Empty;
foreach (char ch in testString)
{
if (ch 二二’i' | | ch 二二’u') newString += ch. ToString();
}
Console. WriteLine(newString);
}
}
哪项的输出是正确的?()
A. iuui B. V
C. Vsal Stdo 2005 D. Visual Studio 2005
以下类MyClass的属性count属于 属性。
class MyClass
{
int i;
int count
(
get{ return i: }
}
}
B,只写 D,不可读不可写
System. 10. File对象的作用是
A,文件操作 B. GDI+图像输出
(每题5分,共20分)
?
简述类当中有哪些成员及含义。
简述ADO. NET中几个重要对象是什么及作用。
简述Windows窗口程序中有哪些常用的事件,中英文都可以。
(共30分)
下面这段程序要完成的功能是:从输入的字符串中找出小写字母并输出到终端。请 检查下列代码,找出所有错误的代码,并写出该行完整的正确代码。
using System;
public class Program
3- {
4. static void Main(string [] args)
5- {
string inputString=();
string lo werCase=string .Empty;
foreach (char ch in inputString)
if(ch>='a'||chv&)
lowerCase+=;
("小写字母有:"+lowerCase);
}
}