计算机二级Delphi常见考点整理试题及答案
姓名:____________________
一、单项选择题(每题2分,共10题)
1.在Delphi中,以下哪个是默认的整数类型?
A.byte
B.integer
C.longint
D.string
2.以下哪个是Delphi中的字符串类型?
A.byte
B.string
C.integer
D.boolean
3.在Delphi中,如何声明一个数组?
A.vararray:array[1..10]ofinteger;
B.arrayarray:[1..10]ofinteger;
C.vararray[1..10]ofinteger;
D.array[1..10]ofinteger;
4.以下哪个是Delphi中的布尔类型?
A.byte
B.string
C.boolean
D.integer
5.在Delphi中,如何定义一个过程?
A.procedureMyProcess;
B.functionMyProcess;
C.varMyProcess;
D.typeMyProcess;
6.在Delphi中,以下哪个是动态数组的定义方式?
A.vararray:array[1..10]ofinteger;
B.arrayarray:[1..10]ofinteger;
C.vararray[1..10]ofinteger;
D.array[1..10]ofinteger;
7.在Delphi中,如何定义一个类?
A.procedureMyClass;
B.functionMyClass;
C.varMyClass;
D.typeMyClass;
8.以下哪个是Delphi中的记录类型?
A.varrecord:record;
B.recordrecord;
C.varrecord[1..10]ofrecord;
D.record[1..10]ofrecord;
9.在Delphi中,以下哪个是动态数组的声明方式?
A.vararray:array[1..10]ofinteger;
B.arrayarray:[1..10]ofinteger;
C.vararray[1..10]ofinteger;
D.array[1..10]ofinteger;
10.在Delphi中,如何定义一个函数?
A.procedureMyFunction;
B.functionMyFunction;
C.varMyFunction;
D.typeMyFunction;
二、填空题(每空2分,共5题)
1.在Delphi中,默认的浮点数类型是_______。
2.Delphi中的字符串类型是_______。
3.在Delphi中,声明一个整型数组需要使用_______关键字。
4.在Delphi中,定义一个布尔类型变量需要使用_______关键字。
5.在Delphi中,声明一个动态数组需要使用_______关键字。
三、简答题(每题5分,共5题)
1.简述Delphi中数组的特点。
2.简述Delphi中过程和函数的区别。
3.简述Delphi中类和对象的关系。
4.简述Delphi中记录类型的特点。
5.简述Delphi中动态数组的声明和使用方法。
四、编程题(共10分)
编写一个Delphi程序,实现以下功能:
1.定义一个整型数组,长度为5。
2.通过循环为该数组赋值。
3.打印数组中的所有元素。
二、多项选择题(每题3分,共10题)
1.在Delphi中,以下哪些是有效的数据类型?
A.integer
B.string
C.boolean
D.record
E.object
2.以下哪些是Delphi中的基本控制结构?
A.if-then
B.for
C.while
D.try-catch
E.case
3.在Delphi中,如何声明一个指向特定数据类型的指针?
A.varPointer:^integer;
B.Pointerinteger;
C.^integerPointer;
D.^integervarPointer;
4.以下哪些是Delphi中的集合类型?
A.TList
B.TSet
C.TQueue
D.TStack
E.TDictionary
5.在Delphi中,如何声明一个动态字符串?
A.varDynString:string;
B.DynStringstrin