c#winform笔试测试题.docx

上传人:b****1 文档编号:2952524 上传时间:2023-05-05 格式:DOCX 页数:15 大小:88.06KB
下载 相关 举报
c#winform笔试测试题.docx_第1页
第1页 / 共15页
c#winform笔试测试题.docx_第2页
第2页 / 共15页
c#winform笔试测试题.docx_第3页
第3页 / 共15页
c#winform笔试测试题.docx_第4页
第4页 / 共15页
c#winform笔试测试题.docx_第5页
第5页 / 共15页
c#winform笔试测试题.docx_第6页
第6页 / 共15页
c#winform笔试测试题.docx_第7页
第7页 / 共15页
c#winform笔试测试题.docx_第8页
第8页 / 共15页
c#winform笔试测试题.docx_第9页
第9页 / 共15页
c#winform笔试测试题.docx_第10页
第10页 / 共15页
c#winform笔试测试题.docx_第11页
第11页 / 共15页
c#winform笔试测试题.docx_第12页
第12页 / 共15页
c#winform笔试测试题.docx_第13页
第13页 / 共15页
c#winform笔试测试题.docx_第14页
第14页 / 共15页
c#winform笔试测试题.docx_第15页
第15页 / 共15页
亲,该文档总共15页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

c#winform笔试测试题.docx

《c#winform笔试测试题.docx》由会员分享,可在线阅读,更多相关《c#winform笔试测试题.docx(15页珍藏版)》请在冰点文库上搜索。

c#winform笔试测试题.docx

c#winform笔试测试题

C#winform笔试测试题(100分)

一.选取题(2*30=60)

1.如下C#程序代码,程序运营时在控制台打印输出值为()。

(选取一项)

Intcount=3;

while(count>1){

Console.Write(--count);

}

a)32

b)321

c)21

d)2

2.在C#中,下列代码运营成果是()(选取一项)

UsingSysatem;

ClassTest{

Staticvoidmain(string[]args){

String[]strings={“a”,”b”,”c”,};

Foreach(stringinfoinstrings){

Console.write(info);

}

}

}

(a)abc

(b)a

(c)b

(d)c

3.既有如下一段C#代码,该代码运营成果是()。

(选取一项)

PublicstaticvoidMain()

{

For(inti=1;i<=3;i++)

{

Switch(i)

{

Case1;

Console.Write(i.ToString());

Break;

Default;

Console.Write((i*2).ToString());

Break;

}

}

}

a)146

b)有编译错误

c)246

4.在C#中,下列代码运营成果是()。

(选一项)

Int[]age=newint[]{16,18,20,14,22};

Foreach(intiinage){

If(i>18)

Continue;

Console.Write(i.ToString()+””);

}

a)1618201422

b)16181422

c)161814

d)1618

5如下关于C#代码说法对的是()。

(选取一项)

for(inti=1;i<=3;i++)

{

switch(i)

{

case1:

Console.Write(i.ToString());

case2:

Console.Write((i*2).ToString());

case3:

Console.Write((i*3).ToString());

}

}

a)123

b)146

c)语法错误

d)123469

6.运营如下C#代码,其输出成果是()。

(选取一项)

staticvoidMain()

{

stringtest="ABCD";

foreach(charcintest)

{

Console.Write(c);

}

}

a)ABCD

b)DCBA

c)A

B

C

D

d)D

C

B

A

7.C#语言提供了四种不同循环构造,其中(D)循环构造在Java语言JDK1.5(含)此前版本中没有相应类似循环构造。

(选取一项)

a)while

b)dowhile

c)for

d)foreach

8.在c#程序中,己知某一维数组名称为myArray,则该数组长度为()。

(选取一项)

a)myArray.Length

b)myArray[].Length

c)myArray[Length]

9.在C#程序中,使用()核心字来创立数组。

(选取一项)

a)new

b)array

c)static

d)this

10.在使用C#语言开发程序时,对于一组五个元素数据(如:

71、11、4、67、39),为了把该数据按升序排序,如果采用冒泡排序法,需要比较()次。

(选取一项)

a)6

b)8

c)10

d)16

11.分析下列C#代码,最后运营成果是()。

(选取一项)

usingSystem;

classTest{

staticvoidMain(){

stringname=”ADO.NET”;

foreach(charcinname){

Console.Write(c);

}

}

}

a)name

b)ADO.NET

c)编译出错,存在语法错误

d)cccc

12.多数编程语言都提供数组这种数据存储构造来存储同种类型各种数据元素。

在C#语法中关于数组定义对的是()。

(选取一项)

a)intiArray=newint[10];

b)int[]iArray=newint;

c)int[]iArray=newint[10];

d)int[]iArray=newint(10);

13.既有如下一段C#代码,该代码运营成果是()。

(选取一项)

publicstaticvoidMain(){

for(inti=1;i<=3;i++){

switch(i){

case1:

Console.Write(i.ToString());

break;

default:

Console.Write((i*3).ToString());

break;

}

}

}

a)169

b)有编译错误

c)369

d)123

14.在c#语言中,已知数组MyArray,使用冒泡排序为此数组排序,两处下划线某些应

填入是()。

for(inti=0;i<____________________;j++)

{

For(intj=0;j<_____________________;j++)

{

if(MyArrayljl

{

temp=MyArray[j];

MyArray[j]=MyArray[j+l[;

MyArray[j+1]=temp;

}

}

}(选取一项)

a)MyArrayLength一1

MyArrayLength一1一i

b)MyArray.Length一1一i

MyArrayLength-1

c)MyArrayLength

MyArrayLength-i

d)MyArray.Length-i

MyArray.Length

15.分析下列c#程序代码,程序运营时在控制台打印输出值为()。

staticvoidMain(string[]args)

{

intcount=5:

do{

Console.Write(++count);

}while(count<5);

}(选取一项)

a)5

b)6

c)4

d)没有输山

16.分析如下C#代码,运营后在屏幕输出构造是()。

(选取一项)

UsingSystem;

ClassClass1{

staticvoidMaic(string[]args)

{

Intcount=8;

Run(count);

Console.Write(count);

}

PrivatestaticvoidRun(intcount)

{

Count=count+88;

Console.Write(count);

}

}

a)968

b)896

c)9696

d)编译错误

17.分析如下C#代码,编译运营成果是()。

(选一项)

UsingSystem;

ClassClass1{

StaticvoidMain(string[]args){

Intage=5;

Run(age);

Console.Wrtie(age);

}

PrivatestaticvoidRun(intage){

Age=age+55;

Console.Write(age);

}

}

a)输出:

605

b)输出:

555

c)输出:

506

d)编译出错

18.分析如下C#代码,运营后在屏幕输成果是().(选取一项)

UsingSystem;

ClassClass1{

StaticvoidMain(string[]args)

{

Count=count+8;

Run(count);

Console.write(count);

}

PrivatestaticvoidRun(intcount);

{

Count=count+88;

Console.Write(count);

}

}

a)968

b)896

c)9696

d)编译错误

19.分析如下C#代码,运营后在屏幕输成果是().(选取一项)

PublicclassText

{

Intcount=9;

Publicvoidcount1()

{

Count=10;

System.out.println(“count=”+count);

}

Publicvoidcount2()

{

System.out.println(“count=”+count);

}

Publicstaticvoidmain(Stringargs[])

{

Textt=newTest();

t.count1();

t.count2();

}

}

a)count1=9

count2=9

b)count1=10

count2=9

c)count1=10

count2=10

d)count1=9

count2=10

20.在C#语言中,顾客自定义办法访问修饰符为()时,该办法可以被其她类成员访问。

(选取一项)

a)public

b)private

c)static

d)void

21.使用C#开发控制台应用程序时,如果需要程序接受顾客输入整形数字,则应当使用一下()语句实现。

(选取一项)

a)inti=Console.ReadLine().int();

b)inti=int(Console.ReadLine());

c)inti=Console.ReadLine();

d)inti=int.Parse(Console.ReadLine());

22.在C#中解决字符串办法中,()办法用于去除字符串两端空格。

(选取一项)

a)Join()

b)Compare()

c)Trim()

d)Split()

23.在c#中解决字符串办法中,()办法用于获得字符串小写形式。

(选取一项)

a)Join()

b)ToUpperO

c)ToLower0

d)Split()

24.在c#开发程序中,选项中可以在屏幕上输出如下文本语句是()。

(选取一项)

10*10=100

a)Console.WriteLine({0}*{1}={2},10,10,l00);

b)Console.WriteLine(“{0}*{1}=(2},10,10,10*10”);

c)stringnumber=stringFormat(“{0}*{1}={2}”,10,10,10*10);

Console.WriteLine(number);

d)stringnumber=stringFormat({0}*{1}={2},10,10,10*10);

Console.WriteLine(number);

25.在WinForms窗体中,为了禁用一种名为btnOpenButton控件,下列做法对的是()。

(选取一项)

a)btnOpen.Enable=true;

b)btnOpen.Enable=false;

c)btnOpen.Visible=false;

d)btnOpen.Visible=true;

26.在WinForms窗体控件文本框(TextBox)属性中,()属性控制该文本框中可以

输入最大字符数。

(选取一项)

a)max

b)Multiline

c)Maxlength

d)MaximizeBox

27.在WinForms窗体设计过程中,开发人员需要一种控件可以显示按钮、标签、下拉按钮、文本框、组合框等,好可以显示图片文字,如下控件中()可以满足上述规定。

(选取一项)

a)计时器

b)选项卡

c)工具条

d)状态条

28.在WinForms窗体frmCarsInfo中有一种数据网格视图控件DataGridView1,如下代码为在DataGridView1中显示表carsinfo中数据代码片段,其中DBHelper.Connection为数据库连接对象。

代码中存在错误是第()行。

(选取一项)

privatevoidfrmCarsInfo_load(objectsender,EvertArgse){

SqlDataAdapterdataAdapter;

DataSetdataset;

stringsql="select*fromcarsinfowherebrand=’福美来’";

dataAdapter=newSqlDatapter(sql,DBHelper.Connection);//1

dataset=newDataSet("car");//2

dataAdapter.Fill("carsInfo",dataSet);//3

this.dataGridView1.DataSource=dataset.Tables["carsInfo"];

}

a)1

b)2

c)3

d)4

e)没有错误

29.NETFrameWork包括公共语言运营库和()两个某些(选取一项)

a)公共语言运营库

b).NETFrameWork类库

c)通用类型系统

d)实时编译器

30.在ADO.NET中,下列代码运营后输出成果是()。

(选取一项)

DataTabledt=newDataTable();

dt.Columns.Add("编号",typeof(System.Int16));

dt.Columns.Add("成绩",typeof(System.Single));

Console.WriteLine(dt.Columns[1].DataType);

a)System.Int16

b)System.Single

c)编号

d)成绩

二.填空题(4*4=16)

1.在代码中咱们使用了一对____和____命令,并加以阐明字符,形成了一种区域,开发工具检测到该指令后会对代码界面进行解决,然后可以将此段代码进行折叠,便于查看,还提供了预览功能

2.当需要向顾客呈现某些信息,并还需接受顾客修改。

或者由顾客处提取信息时,需要使用____控件。

其数据类型为____。

3.创立MDI父窗体办法与其她窗体相似,但是为了使之成为MDI父窗体,必要将____属性设立为____。

4.面向对象3个重要特性是____、_______和____。

三.简答题(24分)

1.请简述CLR作用(2分)

2..NETFramework数据提供程序涉及哪4个核心对象,写出这些对象类并简述其作用(2分)

3.请写出MDI父窗体设立以及子窗体(TestForm)弹出代码(2分)

4.请简述你对DataSet结识,并描述其构造(4分)

5..net平台和c#区别(2分)

6.看图写出如下效果图中按你相应代码(12分)

规定:

写出查找按钮中代码,和dbhelp类中代码

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 小学教育 > 语文

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2