文档库 最新最全的文档下载
当前位置:文档库 › VB 2010秋2011春真题汇总

VB 2010秋2011春真题汇总

VB 2010秋2011春真题汇总
VB 2010秋2011春真题汇总

江苏省计算机等级考试

2010秋

第二部分Visual Basic程序设计

一、选择题(用答题卡答题,答案依次填写在21~30答题号内)

21.以下有关事件过程的说法中,正确的是21 。

A. 所有的事件过程都是Sub子过程

B. 所有的事件过程都没有参数

C. 所有的事件都是由用户的操作直接引发的

D. 事件过程不能使用Call语句调用执行

22. 以下语句中,正确的是22 。

A. List1.AddItem x, “=”, y

B. Picture1.Print x, “=”, y

C. Text1.Text= x, “=”, y

D. Label1.Caption= x,”=”,y

23. 以下有关VB程序书写规则的说法中,错误的是23 。

A. 一行可以书写多余语句,语句间用“:”分隔

B. 使用注释时,“’”可与注释语句定义符“Rem”互换使用

C. 过长的语句,可以使用续行标示“_”,分写在多行上

D. 代码输入时,可不用区分字母大小写,系统会将“保留字”首字母自动改写为大写

24. 设变量I和J是整型变量,K是长整型变量。I已赋值32763,J和K分别赋值5。若接着执行以下语句,可正确执行的是24 。

A. I=I+K

B. J=I+K

C. K=I+J+K

D. K=K+I+J

25. 以下关系表达式中,运算结果为False的是25 。

A. CInt(3.5)-Fix(3.5)>=0

B. CInt(3.5)-Int(3.5)>=0

C. Int(3.5)+Int(-3.5)>=0

D. Int(3.5)+Fix(-3.5)>=0

26. 以下字符运算表达式中,其功能与函数Mid(s,i,i)相同的是26 。

A. Left(s,i) & Right(s,Len(s)-i)

B. Left(Right(s,Len(s)-i+1),i)

C. Left(Right(s,i),Len(s)-i+1)

D. Left(s,Len(s)-i) & Rigth(s,i)

27. 数学表达式

y

x x

e y x

-+

+3

3sin

x的VB算术表达式为27 。

A. Sqr(x*y^3)+Abs(Exp(x)+Sin(x)^3/(x-y))

B. Sqr(x*y^3)+Abs((Exp(x)+Sin(x)^3)/(x-y))

C. Sqr(x*y^3)+Abs(Exp(x)+Sin(x)^3/x-y)

D. Sqr((x*y)^3)+Abs(Exp(x)+Sin(x)^3/(x-y))

28. 以下有关数组的说法中,错误的是28 。

A. 使用Redim语句,可以改变任何数组的大小与维数

B. 使用Redim语句,可以定义一个新数组

C. 使用Redim语句重新定义动态数组时,维界表达式中可以采用变量

D. 使用Redim语句重新定义的新数组,既可比原数组大,也可比原数组小

29. 以下有关Function过程的说法中,正确的是29 。

A. 函数名在过程上只能被赋值一次

B. 如果在函数体内没有给函数名赋值,则该函数无返回值

C. 如果在定义函数时没有说明函数的类型,则该函数是无类型的

D. 执行函数过程中的Exit Function 语句,将退出该函数,返回到调用点

30. 以下有关文件用法的描述中,正确的是30 。

A. 只有顺序文件在读写前需要使用Open语句打开

B. 使用同一个文件号,可同时打开多个不同的文件

C. 如果以Input方式试图打开一个不存在的顺序文件,则会出错

D. 如果程序中缺少Close语句,即使程序运行结束,打开的文件也不会自动关闭

二、填空题(请将答案填写在答题纸的相应答题号内,每个答案只占一行)

1.运行下面程序,单击CmdRun,在窗体上显示a的值是(1);b的值是(2);i的值是(3)。

Option Explicit

Private Sub CmdRun_Click()

Dim i As Integer, a As Integer, b As Integer

a = 1:

b = 10

For i = a To b Step a + 1

a = a + 1

b = b + 1

i = i + 1

Next i

Print a, b, i

End Sub

2.执行下面程序,单击Command1,数组元素a(3,2)的值是(4);a(1,2)的值是(5);a(2,3)的值是(6)。

Option Explicit

Option Base 1

Private Sub Command1_Click()

Dim n As Integer, i As Integer, j As Integer

Dim a(3, 3) As Integer, k As Integer

n = 3: k = 1

i = n: j = (n + 1) / 2

a(i, j) = k

For k = 2 To n * n

i = i + 1: j = j + 1

If i > n And j <= n Then

i = 1

ElseIf i <= n And j > n Then

j = 1

ElseIf i > n And j > n Then

i = i - 2: j = j - 1

ElseIf i <= n And j <= n And a(i, j) <> 0 Then

i = i - 2: j = j - 1

End If

a(i, j) = k

Next k

For i = 1 To n

For j = 1 To n

Pic1.Print Right(" " & Str(a(i, j)), 3);

Next j

Pic1.Print

Next i

End Sub

3.运行下面的程序,单击Cmd1,窗体上显示的第一行是(7);第二行是(8);最后一行是(9)。

Option Explicit

Private Sub Cmd1_Click()

Dim A As Integer

A = 3

Call Sub1(A)

Print A

End Sub

Private Sub Sub1(X As Integer)

X = X * 2 + 1

If X < 10 Then

Call Sub1(X)

End If

X = X * 2 + 1

Print X

End Sub

4.执行下面程序,单击按钮CmdRun,窗体上显示的第一行结果是(10);UBound(a)的值是(11);其中a(1)的值为(12)。

Option Explicit

Private Sub CmdRun_Click()

Dim St As String, i As Integer

Dim a() As String, j As Integer, k As Integer

St = "abcd"

Call sub1(St)

Print St

For i = 1 To Len(St)

For j = i + 1 To Len(St)

If Mid(St, i, 1) = Mid(St, j, 1) Then Exit For

Next j

If j > Len(St) Then

k = k + 1

ReDim Preserve a(k)

a(k) = Mid(St, i, 1)

Print "a("; k; ")="; a(k)

End If

Next i

End Sub

Private Sub sub1(S As String)

Dim i As Integer

For i = 1 To Len(S) \ 2

Mid(S, i, 1) = Mid(S, Len(S) - i + 1, 1)

Next i

End Sub

5.执行下面程序,在文本框Text1中输入“21 23 2 3 5 17 54#”后,单击命令按钮Cmd1,数组元素A(1)的值是(13);A(3)的值是(14);A(5)的值是(15)。Option Explicit

Private Sub Cmd1_Click()

Dim A() As Integer, K As Integer

Dim L As Integer, S As String

S = Text1

Do

K = K + 1

ReDim Preserve A(K)

L = InStr(S, " ")

If L <> 0 Then

A(K) = V al(Left(S, L - 1))

S = Right(S, Len(S) - L)

Else

A(K) = V al(S)

End If

Loop Until L = 0

Call exchang(A)

For K = 1 To 7

Text2 = Text2 & A(K) & " "

Next K

End Sub

Private Sub exchang(A() As Integer)

Dim i As Integer, Tem As Integer

Dim Point1 As Integer

Point1 = 1

For i = 1 To UBound(A)

If A(i) Mod 3 = 0 Then

Tem = A(i)

A(i) = A(Point1)

A(Point1) = Tem

Point1 = Point1 + 1

End If Next i End Sub

6.本程序的功能是,利用下列公式求函数cos(x)的近似值,规定通项的绝对值≤10-6时结束计算。请完善程序。 ∑==

???++

=0

6

4

2

6!

x

-

4!

x

2!

x

-1cos(x)k k

a

1 k=0

通过公式可知: a k =

)

2)(12()1(a 2

1-k k k x

--? k ≥1

Option Explicit

Private Sub Command1_Click()

Dim S As Single, T As Single, K As Integer, x As Single Const eps As Single = 0.000001 x = V al(Text1)

'(16) S = 1 T = 1

Do

T = '(17) S = S + T K = K + 1

Loop While '(18) Text2 = S End Sub

7.本程序的功能是找出一组连续的整数,它们的和数等于给定的数。通常给定一个数,可能会找出多组符合要求的连续整数。查找的方法是穷举法。请完善本程序。 Option Explicit

Private Sub CmdRun_Click()

Dim m As Integer, sum As Integer, st As String Dim i As Integer, j As Integer, k As Integer m = Text1

For i = 1 To m - 1

'(19) For j = i To m

sum = '(20) If sum = m Then

st = "" 'st 赋以空值 For k = i To j

st = '(21)

Next k

List1.AddItem Left(st, Len(st) - 1)

End If

Next j

Next i

End Sub

8.本程序的功能是将汉字的区位码转换成以十六进制数形式表示的机内码。汉字的区位码由4位数字组成,前两位数字表示汉字在编码表中的区号,后两位数字表示位号,区号和位号均为十进制数。例如汉字“中”的区位码是5448,即“中”的区号是54,位号是48。将区号与位号分别加上160,再转换成十六进制数形式,就是“中”的机内码。请完善本程序。Option Explicit

Private Sub CmdChange_Click()

Dim qw As String, jn As String

qw = Text1

Text2 = qw2jn(qw)

End Sub

Private Function qw2jn(st As String) As String

Dim n1 As Integer, n2 As Integer

n1 = V al(Left(st, 2)) + 160

n2 = '(22)

qw2jn = d2h(n1) & d2h(n2)

End Function

Private Function d2h(d As Integer) As String

Dim p As Integer, q As String * 1

Do

p = '(23)

If p > 9 Then

q = Chr(55 + p)

Else

q = CStr(p)

End If

d2h = '(24)

d = d \ 16

Loop Until '(25)

End Function

9.本程序的功能是查找一组数据中的众数。所谓众数,就是在这组数据中出现次数最多的数。注意:一组数据中的众数可能有多个(即有多个数据的出现次数相同)。事件过程Cmdfind 主要功能是n个随机整数存入数组,再调用Freq过程,求出数组中每个不相同的数据出现的次数;再求出其中最大的出现次数值,最后,将求出相应的众数输出。请完善本程序。Option Explicit

Option Base 1

Private Sub CmdFind_Click()

Dim a() As Integer, n As Integer, i As Integer

Dim shu() As Integer, cs() As Integer, max As Integer

n = InputBox("输入数据个数:", "查找众数", 20)

ReDim a(n)

Randomize

For i = 1 To n

a(i) = Int(Rnd * 5) + 5

Text1 = Text1 & Str(a(i))

If i Mod 10 = 0 Then Text1 = Text1 & vbCrLf

Next i

Call freq(a, shu, cs)

max = cs(1)

For i = 2 To UBound(cs)

If cs(i) > max Then

'(26)

End If

Next i

For i = 1 To UBound(cs)

If Then Text2 = Text2 & shu(i) & " " '(27) Next i

End Sub

Private Sub freq(a() As Integer, shu() As Integer, cs() As Integer)

'Shu 数组用于存放A数组中不相同数据的值

'Cs 数组用于存放对应不相同数据出现的次数

Dim i As Integer, j As Integer, js As Integer, n As Integer

For i = 1 To UBound(a)

js = 1

For j = 1 To n '搜索数组a中不相同的数据

If shu(j) = a(i) Then Exit For

Next j

If Then '(28)

n = n + 1

ReDim '(29)

shu(n) = a(i)

For j = i + 1 To UBound(a)

If a(j) = a(i) Then '(30) Next j

cs(n) = js

List1.AddItem a(i) & "----" & js

End If

Next i

End Sub

2010秋上机考试第1场VB01

一、改错题(14分)

[题目]本程序的功能是,找出10~100之间的所有只有奇数真因子的整数。所谓数据n的真因子是指除1和n之外的因子。

Option Explicit

Option Base 1

Private Sub Command1_Click()

Dim fac() As Integer, n As Integer

Dim i As Integer, sn As String, flag As Boolean

flag = False

For n = 10 To 100

Call jsyz(n, fac, flag)

If flag Then

sn = n & ":"

For i = 1 To UBound(fac)

sn = sn & fac(i) & ","

Next i

List1.AddItem Left(sn, Len(sn) - 1)

End If

Next n

End Sub

Private Sub jsyz(n As Integer, fa() As Integer, flag As Boolean)

Dim i As Integer, k As Integer, n As Integer

For i = 2 To n - 1

If n Mod i = 0 Then

If i Mod 2 <> 0 Then

k = k + 1

ReDim fa(k)

fa(k) = i

Else

Exit Sub

End If

End if

Next i

If k <> 0 Then flag = True

End Sub

二、编程题(26分)

[题目]编写程序,随机生成一个元素值为10~40之间整数的4行5列数组;找出该二维数组的最大元素与最小元素,并将最大元素与最小元素的值以及相应的行号和列号输出到图片框中。(注意:数组最大元素与最小元素都可能有多个)

[编程要求]

1.程序参考界面如图所示,编程时不得增加或减少界面对象或改变对象的种类,窗体及界

面元素大小适中,且均可见;

2.运行程序,按“运行”按钮,则生成随机数组并显示在图片框Pic1中,并在图片框Pic2中输出数组最大元素值和最小元素值及相应的数组元素的行号与列号;按“清除”按钮,将两个图片框清空,焦点置于“运行”按钮;按“结束”按钮,结束程序运行;

3.程序中定义一个通用过程maxmin,用于求二维数组最大元素值与最小元素值。

2010秋上机考试第2场VB02

一、改错题(14分)

[题目]本程序的功能是,查找首末两位数之和与中间两位数字之和相等的四位素数。Option Explicit

Private Sub CmdFind_Click()

Dim i As Integer, fg As Boolean

For i = 1001 To 9999

fg = False

Call PD(i, fg)

If Prime(i) And fg Then List1.AddItem i

Next i

End Sub

Private Function Prime(n As Integer) As Boolean

Dim k As Integer

For k = 2 To Sqr(n)

If n Mod k = 0 Then Exit Function 'Exit Function

Next k

Prime = True

End Function

Private Sub PD(ByV al n As Integer, flg As Boolean) 'byval

Dim i As Integer, A(4) As Integer, s As Integer

Dim L As Integer

L = Len(CStr(n)) 'CStr

For i = 1 To L

A(i) = n Mod 10

n = n \ 10

Next i

If A(1) + A(4) = A(2) + A(3) Then

flg = True

End If

End Sub

二、编程题(26分)

[题目]编写程序,输入一个5位以上的整数,将组成该数的各位数字重新排列成一个与原整数位数相同的最小整数。

[编程要求]

1.程序参考界面如图所示,编程时不得增加或减少界面对象或改变对象的种类,窗体及界面元素大小适中,且均可见;

2.运行程序,在输入数据文本框中输入一个5位以上的整数后,按“开始”按钮,则在相应的文本框中,显示得到的最小数;按“清除”按钮,将所有文本框清空,焦点置于输入数据文本框上;按“结束”按钮,结束程序运行;

3.程序中应定义通用过程,用于求由给定整数的各位数字组成的最小数。

2010秋上机考试第3场VB03

一.改错题(14分)

[题目]本程序的功能是,在5张卡片上写有1、2、3、4、5五个数,对卡片进行排列(5张卡片的全排列共有5!种),找出同时符合以下两个条件的所有排列:①相邻卡片上的数不相邻;②首尾卡片上的数不相邻。这里所谓相邻是指两数差的绝对值为1。

Option Explicit

Private Sub Command1_Click()

Dim i As Long, j As Integer, S As String * 5, Char(5) As String * 1

Dim BL As Boolean

BL = False

For i = 12345 To 54321

S = CStr(i)

Call validate(S, Char, BL)

If BL Then

For j = 2 To Len(S)

If Abs(Char(j - 1) - Char(j)) = 1 Then

Exit For

End If

Next j

If j > Len(S) Or Abs(Char(1) - Char(5)) > 1 Then

List1.AddItem i

End If

End If

Next i

End Sub

Private Sub validate(S As String, Ch() As String * 1, flg As Boolean)

Dim i As Integer, j As Integer

For i = 1 To 5

Ch(i) = Mid(S, i, 1)

If Ch(i) = 0 Or Ch(i) > 5 Then Exit For

For j = 1 To i - 1

If Ch(i) = Ch(j) Then

Exit Sub

End If

Next j

Next i

flg = True

End Sub

二、编程题(26分)

[题目]编写程序,在1001~9999范围内,找出满足下列条件的数对:①首尾数字相同的素数,若将数的百位和十位数字互换后得到新4位数也是素数;②数对的第一个数小于第二个数。例如:(1021 1201)是满足条件的数对,而(1201 1021)则不满足条件。

[编程要求]

1.程序参考界面如图所示,编程时不得增加或减少界面对象或改变对象的种类,窗体及界面元素大小适中,且均可见;

2.运行程序,找出满足条件的数对,按图示的格式将数对显示在多行文本框Text1中;按“清除按钮”,将文本框清空,并将焦点设置在“运行”按钮上;按“结束”按钮,则结束程序运行;

3.程序中要求定义两个通用过程;一个是判断一个数是否是素数的Function过程,另一个是将首尾数字相同数的百位和十位数字互换后得到一个新的4位数的子程序过程。

2010秋上机考试第3场VB04

一.改错题(14分)

[题目]本程序的功能是找出10000~60000之间,所有由不同数字组成的完全平方数。所谓完全平方数是指其为某整数的平方。

Option Explicit

Private Sub Command1_Click()

Dim n As Long, i As Integer

For n = 10000 To 60000

If Int(Sqr(n)) = Sqr(n) And validate(n) Then

List1.AddItem n & "==>" & Sqr(n) & "^2"

End If

Next n

If List1.ListCount = 0 Then List1.AddItem "无符合要求的数"

End Sub

Private Function validate(n As Long) As Boolean

Dim k As Integer, num() As Integer

Dim i As Integer, j As Integer

Do

k = k + 1

ReDim num(k)

num(k) = n Mod 10

n = n \ 10

Loop Until n < 0

For i = 1 To UBound(num) - 1

For j = i + 1 To UBound(num)

If num(i) = num(j) Then Exit Function

Next j

Next i

validate = True

End Function

二、编程题(26分)

[题目]编写程序,生成试验数据的茎叶图,并显示不同区间数据的个数。

设试验数据取值在30~99之间(见图),其中在30~39之间有6个数31、39、39、32、39、31,则可表示为3 | 1 9 9 2 9 1;在40~49之间有2个数43、49,则可表示为4 | 3 9;依此类推,由此得到的图形就称为数据的“茎叶图”。

[编程要求]

1.程序参考界面如图所示,编程时不得增加或减少界面对象或改变对象的种类,窗体及界面元素大小适中,且均可见;

2.运行程序,按“运行”按钮,在多行文本框Text1中分两行(每行10个数)显示20个30~99之间的随机整数,在列表框List1中生成前述数据的茎叶图,并在多行文本框Text2中显示每个区间数据的个数;按“清除”按钮,将所有文本框和列表框清空,焦点置于“运行”按钮;按“结束”按钮,结束程序运行;

3.程序中应定义一个通用过程,用于求一维数组数据的茎叶图以及各个区间数据的个数。

第二部分Visual Basic 程序设计

一.选择题

21.以下说法中,正确的是_____________。

A. 属性是对象的特征,所有的对象都有相同的属性

B.属性值只能在属性窗口中设置

C.在程序中可以用赋值语句给对象的任何一个属性赋值

D.对象的运行时属性不出现在对象属性窗口中

22.下面4个语句中,错误的是________。

A.N=InputBox(“输入N:”,,5); B .InputBox((“输入N:”,,5))

C. MsgBox“请回答”

D. K = MsgBox(“请回答”)

23.若设X = 1,Y = 2,则不能在窗口上显示“A = 3”的语句的是___________

A . Print A = X+Y

B . Print “ A =”; X+Y

C . Print “ A =” + Str(X+Y)

D . Print “ A =” & X+Y

24.表达式InStr(4,”abcabca”,”c”)+Int(2.5)的值是____________

A. 7 B . 8 C . 5 D . 9

25 .以下有关数组的说法中,错误的是____________

A . 用ReDim语句重新定义动态数组时,其下标的上下界可以使用赋了值的变量

B . 用ReDim语句重新定义动态数组时,不能改变已经说明过的数组的数据类型

C. 使用ReDim语句一定可以改变动态数组的上下界

D. 定义数组时,数组维界值可以不是整数

26.以下有关过程的说法中,错误的是___________

A . 不论在Function过程中是否给函数名赋过值,都会返回一个值

B.不能在Function与Sub过程内部,再定义Function或Sub过程

C.Function过程与Sub过程,都可以是无参过程

D.过程名可以和主调过程的局部变量同名

27.下列关于菜单的说法中,错误的是__________

A.除了Click事件之外,菜单项不能响应其他事件

B.菜单的名称项(Name属性)不可缺省

C.只有当代码窗口为当前活动窗口时,才能打开菜单编辑器

D.菜单项的快捷键不能任意设置

28.设a=1,b=2,c=3,逻辑表达式ab Xor c

A.False B. -1 C. True D. 1

29.在窗口Form1中用“Public Sub Fun(x As Integer , y As Single)”定义过程Fun,在窗体Form2的某事件过程中定义了变量I和J均为Integer,若要在此过程中调用Form1中的Fun 过程,则下列语句中正确的是_________

A. Call Fun(I,J)

B. Call Form1.Fun(I,J)

C. Fun I ,(J)

D. Form1.Fun I, (J)

30.以下有关文件操作的说法中,正确的是__________________

A. 在某过程中用Open语句打开的文件,只能在这个过程中使用

B.不能用Output,Append方式打开一个不存在的顺序文件

C.在Input方式下,可以使用不同的文件号同时打开同一个文件

D.在不同的过程中,可以用同一个文件号打开不同的文件

二,填空题

1.执行下列程序,单击按钮Command1,窗体上显示的第一行内容是__________,第二行内

容是________,第三行内容是___________。

Option Explicit

Private Sub Command 1_Click()

Dim a As Integer , b As Integer

a = 4

b = 3

Do Until a > 10

b = b/2

Do Until b > 10

a = (a+b)\2+b

b = b+5

Print a,b

Loop

a = a-3

Loop

End Sub

2. 执行下面程序,当单击Cmd1时,在窗体上显示的第一行内容是______,第二行的内容是__,第四行是__________

Option Explicit

Private Sub Cmd1_Click()

Dim a As Integer , b As Integer

a= 1

b = 2

Print fun(2*b, fun(a,(b)))

Print a;b

End Sub

Private Function fun(x As Integer , y As Integer) As Integer

x= x+2

y = x-y+3

fun = x+y

Print fun

End Function

3.执行下面的程序,单击CmdRun后,数组元素a(1,2)的值是_______a(2,1)的值是____ a(3,2)的值是_________

Option Explicit

Option Base 1

Private Sub CmdRun_Click()

Dim A(3,3)As Integer , I As Integer ,j As Integer ,k As Integer ,n As Integer

n = 3

i = 1:j = n

A(i,j) = 1

For k = 2 To n*n

If i+1>n Then

i=n-j+2:j=1

ElseIf i+1<=n And j+1>n Then

J=j-i:i=1

Else

I=i+1:j=j+1

End If

A(i,j)=k

Next k

For i=1 To n

For j=1 To n

PrintA(i,j);

Next j

Print

Next i

End Sub

4.运行程序,二进制在文本Text1中输入用空格分隔的4位1001,0101和0110。单击“处理”按钮,在多行文本框Text2中的第一行显示________,第二行显示________,第三行显示______。

Option Explicit

Private Sub Cmd1_Click()

Dim S(3) As String , n As Integer

Dim i As Integer, k As Integer

K=1

For i=1 To 3

S(i)=Mid(Text1,k,4)

K=k+5

Call Transform(n,S(i))

Text2=Text2 & n & vbCrlf

Next i

End Sub

Private Sub Transform(n As Integer,S As String)

Dim k As Integer, i As Integer, L As Integer L=Len(S) If V al(Mid(S,1,1))=1 Then N =﹣(2 ∧(L-1) Else n=0 End If

For i=2 To L K=Mid(S,i,1)

N=n+k * 2 ∧ (L-i)

Next i

End Sub

5.执行下列程序,单击CmdRun 按钮,则窗体上显示的第一行是___(13)_______,第二行

是____(14)_____,最后一行是___(15)____。

Option Explicit

Private Sub CmdRun_Click() Dim n As Integer For n=4 To 7 If Fun1(n,Sqr(n)) Then

Print n;”SS ”

Else Print n;”HS ” End If

Next n

End Sub

Private Function Fun1(n As Integer,i As Integer) As Boolean If i=1 Then Fun1=True

ElseIf n Mod i<>0 Then Fun1=Fun1(n,i-1) Else

Fun1=False

End If

End Function

6.下面程序的功能是求S 的值。

)

1()12(31)()2)(1(531)

3)(2)(1(31)2)(1()1(3

2

>???+?-????+???+++

???+???++++

??+++

+=

x x

k k x x x x

x x x x

x x x

x s k

计算到第k 项的值小于等于10-6为止。请完善本程序。 Option Explicit

Private Sub Command1_Click()

Dim s As Single, x As Single, k As Integer, t As Single

x = CSng(Text1.Text)

Do

t = pt(x, k)

s = s + t

k = k + 1

Loop Until t <= 0.000001

Text2.Text = CStr(s)

End Sub

Private Function pt(x As Single, n As Integer) As Single

Dim i As Integer

For i = 1 To n

pt =

Next i

pt = pt / x ^ n

End Function

7.下面程序的功能是,找出100~999之间具有以下特点的整数:其全部真因子(1和自身除外的因子)中,所有素数因子之和的2倍等于其余因子的和数。请完善本程序。

Option Explicit

Option Base 1

Private Sub Command1_Click()

Dim i As Long, j As Long, m As Integer, st As String

Dim a() As Integer

For i = 100 To 999

For j = 2 To i - 1

If i Mod j = 0 Then

m = m + 1

a(m) = j

End If

Next j

If m > 0 Then

If yzh(a, st) Then List1.AddItem i & ":" & st

End If

Erase a

Next i

End Sub

Private Function yzh(a() As Integer, st As String) As Boolean

Dim i As Integer, j As Integer

Dim sum1 As Long, sum2 As Long, st1 As String, st2 As String

For i = 1 To UBound(a)

For j = 2 To Sqr(a(i))

If a(i) Mod j = 0 Then Exit For

Next j

If Then

sum1 = sum1 + a(i)

st1 = st1 & a(i) & "+"

Else

sum2 = sum2 + a(i)

st2 = st2 & a(i) & "+"

End If

Next i

If sum1 * 2 = sum2 Then

st = "(" & Left(st1, Len(st1) - 1) & ")*2=" & Left(st2, Len(st2) - 1)

End If

End Function

8.本程序的功能是求-128~+127之间整数n的8位2进制补码。采用的算法是:若n>=0,则直接将其转换为相应的7位2进制数,前面的符号位设定为“0”;若n<0,则将n+128转换为相应的7位2进制数,前面的符号位设定为“1”。请完善本程序。

Option Explicit

Private Sub Command1_Click()

Dim dec As Integer

dec = Text1

If Then

MsgBox "无效数据,请重输!", , "求补码"

Text1 = ""

Text1.SetFocus

Else

Text2 = bm(dec)

End If

End Sub

Private Function bm(n As Integer) As String

If Sgn(n) >= 0 Then

bm = "0" & d2b(n)

Else

n = n + 128

bm =

End If

End Function

Private Function d2b(n As Integer) As String

Dim p As Integer

Do

p = n Mod 2

d2b = CStr(p) & d2b

n = n \ 2

Loop Until

d2b = Right("000000" & d2b, 7)

End Function

9.本程序的功能是,按从大到小的次序给一组正整数标记序次。程序的算法是:先找出原数组中所有的最大数,假如有n个最大数,它们序次均标记为1,已处理的数据值改为-99;再找出所有的次大数,它们的序次标记为n+1……直到所有的数据处理完毕。请完善本程序。(说明:数组sn用于存放数组a中相应的各个元素的序次,数组b用来保留原始数据)Option Explicit

Option Base 1

Private Sub Cmd1_Click()

Dim a(10) As Integer, sn(10) As Integer, b(10) As Integer, i As Integer

For i = 1 To 10

a(i) = Int(Rnd * 61) + 40

b(i) =

Text1 = Text1 & Str(a(i))

Next i

Call order(a, sn)

For i = 1 To 10

List1.AddItem b(i) & "---" & sn(i)

Next i

End Sub

Private Sub order(a() As Integer, sn() As Integer)

Dim i As Integer, j As Integer

Dim n As Integer, maxi As Integer

i = 1

Do While i <= UBound(a)

n =

maxi = a(1)

For j = 2 To UBound(a)

If Then

maxi = a(j)

End If

Next j

For j = 1 To UBound(a)

If Then

sn(j) = i

a(j) = -99

n = n + 1

End If

Next j

i =

2019-2020年中考二模考试英语试卷含答案

2019-2020年中考二模考试英语试卷含答案 注意事项 1.本试卷共七大题,满分100分(不含听力口语30分),考试用时100分钟; 2.答题前,考生务必将自己的姓名、考点名称、考场号、座位号用0.5毫米黑色墨水签字笔填写在答题卡相对应的位置上,并认真榜对二维码上的准考号、姓名是否与本人相符合; 3.答选择题必须用2B铅笔把答题卡上对应题目的答案标号涂黑,如需改动,请用樣皮擦干净后,再选涂其他答案;答非选择题必须用0. 5毫米黑色墨水签字笔写在答题卡指定的位置上,不在答题区内的答案一律无效,不得用其他笔答题; 4.考生答题必须答在答题卡上,答在试卷和草稿纸上一律无效。 一、单项填空(共15小题;每小题1分,满分15分) 从A、B、C、D四个选项中,选出可以填入空白处的最佳选项,并在答题卡上将读项涂黑。 1. Good news! We’ll have ________ one-day holiday. Let’s go on a spring outing. A. a B. an C. the D. / 2. —A friend of ______________ thinks he won’t pass the exam. —I think he should believe in .That's the secret of success. A. my cousin; himself B. my cousin’s; him C. my cousin’s; himself D. my cousins; his 3. —May I have some wine to drink? —No, you ____________. You have to drive home later. A. can’t B. needn’t C. mustn’t D. may not 4. —Could you tell me the way the railway station? —We’re ________ our way there, why not join us? A. at; on B. to; in C. in; at D. to; on 5. —Why _______ you ________your homework so far? —Because I __________a football match from 9 to 11 yesterday evening. A. haven’t; finished; was watching B. won’t; finish; watched C. do n’t; finish; watched D. didn’t; finish; was watching 6. —Finding information is not a big deal today. —Well, the is how we can tell whether the information is useful or not. A. courage B. message C. challenge D. knowledge 7. fast runner Su Bingtian is! He finished______ in the 100- metre race in 9.99 seconds. A. How; first B. What a; first C. What a; the first D. How a; the first 8. —What will be on show next week? —The photos _________________. A. were taken by Henry B. that was taken by Henry C. will be taken by Henry D. taken by Henry 9. —I hear it 's not easy to get a ticket for Captain America Ⅲ, everyone wants to watch it. —Exactly. You can’t find a ____________ film this year. A. less excited B. more exciting C. most exciting D. 1east excited

2019年普通高等学校招生全国统一考试二模英语试题及答案

2019年普通高等学校招生全国统一考试 广东省英语模拟试卷(二) 本试卷分第Ⅰ卷(选择题)和第Ⅱ卷(非选择题)两部分。全卷满分120分, 考试用时120分钟。 注意事项: 1.因本试卷不考听力, 第Ⅰ卷从第二部分的“阅读理解”开始, 试题序号从“21”开始。 2.答卷前, 考生须认真核对条形码上的姓名、考生号、考场号和座位号, 并将其贴在指定位置, 然后用0.5毫米黑色字迹签字笔将自己所在的县(市、区)、学校以及自己的姓名、考生号、考场号和座位号填写在答题卡和试卷的指定位置, 并用2B铅笔在答题卡的“考生号”处填涂考生号。 3.回答选择题时, 选出每小题答案后, 用2B铅笔把答题卡上对应题目的答案标号涂黑; 回答非选择题时, 将答案写在答题卡上, 写在本试卷上无效。 4.考试结束后, 将本试卷和答题卡一并交回。 第二部分阅读理解(共两节,满分40分) 第一节(共15小题; 每小题2分,满分30分) 阅读下列短文,从每题所给的A、B、C和D四个选项中,选出最佳选项,并在答题 卡上将该项涂黑。 A You may have your favorite family spots on Long Island where you frequently take the kids. But there may be unexpected places you haven't explored yet. American Air power Museum A nonprofit organization, AAM's mission is to preserve the legacy(遗产)of all Americans who sacrificed themselves to defend our liberties. They seek educate new generations about their courage, bravery and heroism by presenting aircraft and armor(盔甲)in tire museum through displays, exhibits and programs. Telephone: 020 7841 3600 Cradle of Aviation Museum The Cradle of Aviation Museum features more than 75 planes and spacecraft, a dozen cockpits and 30 hands- on exhibits in nine galleries. A favorite among kids is the Sesame Street show featuring Big Bird, Elmo and more as they learn about the Big Dipper, the North Star the sun and the moon. Telephone: 020 7414 3428 Tackapausha Museum

2019-2020年初三英语二模试卷及答案

2019-2020年初三英语二模试卷及答案 请注意:考生须将1~50题所选答案填涂到答题卡上,答在试卷上无效! 一、单项选择从下列每题所给的选项中,选择一个最佳答案。(15分) 1. I like living in _____ Taizhou. It’s _____ beautiful city with lots of interesting places. A. a; a B. a; the C. /; the D. /; a 2. --Peter sits ______ the window every time he travels. --I know. He enjoys watching the beautiful views through it. A. by B. in C. on D. behind 3. Daniel spends all his free time playing computer games. He________ plays football. A. often B. sometimes C. seldom D. never 4. My grandpa’s favorite food ______ rice dumplings at a very young age. But now he eats little. A. is B. was C. are D. were 5. --Have you got __________ ready for the sports meeting? -- No. We still have ________ to do. A. anything; nothing B. something; everything C. everything; something D. anything; everything 6. --Is it John Smith who will give us a talk tomorrow? --It _________ be. I’m not sure about that. A. must B. could C. should D. has to 7. Peter tried to ____ the underground, but failed. He just saw it passing by at the station. A. get on B. get off C. get away D. get out 8. The TV program called “ A Bite of China” is a ________ that records different kinds of delicious food from various parts of China. We can learn a lot about local culture from it. A. cartoon B. documentary C. chat show D. game show 9. --The missing Malaysia Airlines plane hasn’t been found so far. --_________, but an international effort is continuing. A. Bad luck B. Sounds terrible C. Sorry to hear that D. Cheer up 10. “Wechat”(微信) really makes a great _________ to people’s life. It’s easy for us to keep in touch with others. A. choice B. surprise C. progress D. difference 11. --Frank, you look worried. Anything wrong? --Well. I ________ a test and I’m waiting for the result. A. take B. am taking C. have taken D. will take 12. While the door __________, please go in one after another. Don’t push. A. opens B. closes C. is open D. is closed 13. It’s __________ of him to donate all his collections to the country. A. helpful B. polite C. outgoing D. generous

广州二模英语试题及答案教学内容

第I卷 第二部分阅读理解(共两节,满分40分) 第一节(共15小题;每小题2分,满分30分) 阅读下列短文,从每题所给的四个选项(A、B、C、D)中,选出最佳选项,并在答题卡上将该选项涂黑。 A Many people would love to leave their jobs behind and have a life-changing adventure overseas. They imagine lying under palm trees as the sun goes down. However, life overseas is not always easy, and many are not prepared for the shock of living in an alien culture. The honeymoon period At first, for those who actually decide to move abroad, life is an exciting adventure. They enjoy exploring their new surroundings, and life seems like an extended holiday. They don’t mind trying the local cuisine and discovering the local culture. They can even afford to practice their foreign-language skills without fear of making mistakes. Trouble in paradise In many cases, when people consider moving to another country, they often fail to realize how different life will be. As time goes by, they become frustrated when language and cultural misunderstandings become a daily headache. In this stage, the visitors begin to withdraw from life in the host country and avoid spending time with local people in favor of mixing with others from their own cultural background. The road to recovery Gradually, most visitors realize they must accept the differences and not fight against them. This change encourages them to improve their language skills and slowly they manage to do the things they could easily do at home, such as opening a bank account. This new-found confidence enables them to see a side of life which very few tourists get to witness. Adjusting to life abroad can often be a real problem. The secret to overcoming it is to stop trying to change your host country: you will not succeed. If not, you risk losing your dream and having to return to the old life you wanted to leave behind. 21. Why do people moving abroad feel excited at first? A. They find foreign living much easier. B. They have the necessary language skills. C. They love the adventure and exploration. D. They enjoy meeting people from different cultures. 22. According to the author, what is the main problem many people moving abroad face? A. Homesickness. B. Culture shock C. Health problems. D. Lack of employment. 23. What would the author suggest people moving abroad do? A. Study the local language. B. Go on holidays frequently. C. Learn how to open a bank account. D. Seek out people from their home country. B Australia loves interesting money. In 1988, it was the first country to replace paper money with special plastic banknotes. Now it’s introduced a new five-dollar bill so technologically advanced that many experts are calling it the money of the future! At first glance, the new note looks much like the old one. It has the same pink colour and main pictures on the front and back. But look closer, and you will notice a clear window running down the middle, surrounded by images of the yellow Prickly Moses, a type of Australian plant. Tilt(使倾斜)the note a little and you will see the Eastern Spinebill, an Australian bird, beating its wings as if trying to fly away. Turn the bill from side to side, and you will notice the picture of a small building at the bottom of the note spins, and the image of “5” changes position. While these moveable features are impressive and entertaining, that was not the reason Australian government officials spent ten years developing them. Their primary purpose was to make it impossible for criminals to produce their own fake notes. The new five-dollar note also has something to help blind people easily identify the money. It has a raised bump alongside the top and bottom, enabling blind people to quickly determine its value. The credit for persuading the Australian government to add this all-important bump goes to 15-year-old Connor McLeod. The blind Sydney teenager came up with the idea in 2014 after being unable to tell how much money he had received for Christmas. Connor says he was so embarrassed at not being able to see the difference between notes that he only carried coins to pay for food at the school cafeteria. To

广州二模英语试题及答案

广州二模英语试题及答 案精选文档 TTMS system office room 【TTMS16H-TTMS2A-TTMS8Q8-TTMSHHJ8】

第I卷 第二部分阅读理解(共两节,满分40分) 第一节(共15小题;每小题2分,满分30分) 阅读下列短文,从每题所给的四个选项(A、B、C、D)中,选出最佳选项,并在答题卡上将该选项涂黑。 A Many people would love to leave their jobs behind and have a life-changing adventure overseas. They imagine lying under palm trees as the sun goes down. However, life overseas is not always easy, and many are not prepared for the shock of living in an alien culture. The honeymoon period At first, for those who actually decide to move abroad, life is an exciting adventure. They enjoy exploring their new surroundings, and life seems like an extended holiday. They don’t mind trying the local cuisine and discovering the local culture. They can even afford to practice their foreign-language skills without fear of making mistakes. Trouble in paradise In many cases, when people consider moving to another country, they often fail to realize how different life will be. As time goes by, they become frustrated when language and cultural misunderstandings become a daily headache. In this stage, the visitors begin to withdraw from life in the host country and avoid spending time with local people in favor of mixing with others from their own cultural background. The road to recovery Gradually, most visitors realize they must accept the differences and not fight against them. This change encourages them to improve their language skills and slowly they manage to do the things they could easily do at home, such as opening a bank account. This new-found confidence enables them to see a side of life which very few tourists get to witness. Adjusting to life abroad can often be a real problem. The secret to overcoming it is to stop trying to change your host country: you will not succeed. If not, you risk losing your dream and having to return to the old life you wanted to leave behind. 21. Why do people moving abroad feel excited at first? A. They find foreign living much easier. B. They have the necessary language skills. C. They love the adventure and exploration. D. They enjoy meeting people from different cultures. 22. According to the author, what is the main problem many people moving abroad face? A. Homesickness. B. Culture shock C. Health problems. D. Lack of employment. 23. What would the author suggest people moving abroad do? A. Study the local language. B. Go on holidays frequently. C. Learn how to open a bank account. D. Seek out people from their home country. B Australia loves interesting money. In 1988, it was the first country to replace paper money with special plastic banknotes. Now it’s introduced a new five-dollar bill so technologically advanced that many experts are calling it the money of the future! At first glance, the new note looks much like the old one. It has the same pink colour and main pictures on the front and back. But look closer, and you will notice a clear window running down the middle, surrounded by images of the yellow Prickly Moses, a type of Australian plant. Tilt(使倾斜)the note a little and you will see the Eastern Spinebill, an Australian bird, beating its wings as if trying to fly away. Turn the bill from side to side, and you will notice the picture of a small building at the bottom of the note spins, and the image of “5” changes position. While these moveable features are impressive and entertaining, that was not the reason Australian government officials spent ten years developing them. Their primary purpose was to make it impossible for criminals to produce their own fake notes.

2018年济南市槐荫区二模英语试题及答案

2018年学业水平阶段性调研测试 初三英语试题(2018.5) 本试题分第I卷(选择题)和第II卷(非选择题)两部分,共10页,满分150分。考试时间为120分钟。 答卷前,请考生务必将自己的班级、姓名、座号和准考证号填写在答题卡上,并同时将姓名、准考证号和座号填写在试卷规定的位置。考试结束后,将本试卷和答题卡一并交回。 第I卷(选择题共110分) 注意事项: 每小题选出答案后,用2B铅笔把答题卡上对应题目的答案标号涂黑;如需改动,用橡皮擦干净后,再选涂其他答案标号。 I.听力测试(30分) A)听录音,在每组句子中选出一个你所听到的句子。每个句子听一遍。 1. A. His father is a teacher. B. I have a little brother. C. I’d like a banana. 2. A. Do you often play chess? B. Does the skirt look nice? C. Did you see the lions? 3. A. We watch TV after dinner. B. Sally has long curly hair. C. That is Jenny’s chair. 4. A. Which town did you go to? B. Where’s the nearest zoo? C. What does his son do? 5. A. Don’t run in the hallways. B. Here comes the school bus. C. Let’s go after class. B)听录音,从每题A、B、C三幅图画中选出与听到的对话内容相符的一项。每段对话听两遍。 6. A. B. C. 7. A. B. C. 8. A. B. C. 9. A. B. C. 10. A. B. C.

2020 宝鸡二模英语试题及答案

第二部分阅读理解(共两节,满分40分) 第一节:阅读下面短文,选出最佳选项 A Museums are an important means for cultural exchange and enrichment as well as the development of mutual understanding and cooperation among people. Then how many of these places have you visited? It's time to decide your next travel destination. The Musée du Louvre, Paris, France. It is the world's largest art museum and a historical landmark of Paris. Housed in the Louvre Palace, the museum has been extended many times since its opening in 1793. Its glass pyramid in the main courtyard was designed by Chinese American architect Ieoh Ming Pei, and it later became a signature design of the museum. Visitors to Paris’s paragon(典范), which houses nearly 35,000 works of art, including Leonardo da Vinci’s Mona Lisa, can spend ho urs, days or even weeks exploring the beloved treasure. National Museum of China, Beijing, China. Near Tiananmen Square in Beijing, it's one of the largest museums in the world and the second-most visited art museum in the world, just after the Louvre. Covering a time span from the Yuanmou Man of 1.7 million years ago to the Qing Dynasty (1644-1911), it is devoted to display of treasured collections in the form of various thematic exhibitions, such as the Arts of bronze, porcelain, Chinese calligraphy and paintings, furniture, coins, etc in ancient China. Metropolitan Museum of Art, New York, US. Commonly known as the Met, the museum is among the must-visit attractions in New York City. It stands on the eastern edge of Central Park at Manhattan's Upper East Side. The Met maintains extensive holdings of African, Asian, Oceanian, Byzantine and Islamic art. Every May, the museum holds the luxurious, blockbuster Met Gala, grabbing global attention like the Oscars. British Museum, London, UK. Established in 1753, the British Museum is largely based on the collections of the Irish physician and scientist Sir Hans Sloane. At present, its comprehensive permanent collection has reached 8 million works. It was the first public national museum in the world. If you go, remember to take a photo under the Great Court. 21.What makes the Musée du Louvre different from other museums? A.It has the longest history of all. B.It is a public national museum. C.It owns masterpiece like Mona Lisa. D.It collects works of music throughout the world. 22.Which museum most probably displays the bed of Ming dynasty? A.Metropolitan Museum of Art. B.National Museum of China. C.The Musée du Louvre. D.British Museum. 23.What are visitors suggested doing if they go to British Museum? A.Talking photos of museum’s exhibits. B.Keeping the voice down. C.Exploring museum’s history. D.Having themselves photographed.

中考二模英语试题(含答案)

中考二模英语试题 学校:___________姓名:___________班级:___________考号:___________ Chinese delivery(传送) driver, Gao Zhixiao, was on the cover of Time magazine in March because of his great sense of commitment(使命感). Along with five others, he 1 by the magazine as one of the heroes during the period of the novel coronavirus outbreak. Ever 2 COVID-19 broke out, many restaurants have shut down or changed to takeout-only services. 3 of people have been staying home to avoid getting infected(感染). “People choose to order food online or buy fruit and vegetables to cook at home,” Gao told Time. As a 4 , delivery orders increased a lot. Born into a 5 family in Ningxia , Gao started to make a living in Beijing at age 16. After the novel coronavirus broke out, Gao hesitated(犹豫) for a second to continue working, but then picked up orders 6 he thought customers might be in need. Because of the danger, Gao must be careful to avoid spreading viruses during his route around Beijing, including taking a regular health test and 7 twenty minutes disinfecting his motor bike and clothes each morning. 8 delivering food, Gao once warm-heartedly cooked for an old customer 9 was living alone at her home. It is the ordinary people like Gao that have made the 10 contributions(奉献) in the fight against COVID-19. 1.A.was taken B.was brought C.was chosen D.was followed 2.A.when B.after C.since D.before 3.A.Millions B.Thousands C.Hundreds D.A couple 4.A.reason B.result C.word D.way 5.A.rich B.healthy C.poor D.faraway 6.A.so B.but C.or D.because 7.A.spending B.losing C.paying D.taking 8.A.Except B.Besides C.With D.Without

2014.4.23深圳二模英语试题及答案word版 new

绝密★启用前试卷类型:A 2014年深圳市高三年级第二次调研考试 英语 2014.4.23 本试卷共12页,三大题,满分135分。考试用时120分钟。 注意事项: 1.答卷前,考生首先检查答题卡是否整洁无缺损,监考教师分发的考生信息条形码是否正确;之后务必用0.5毫米黑色字迹的签字笔在答题卡指定位置填写自己的学校、姓名和考生号,同时,将监考教师发放的条形码正向准确粘贴在答题卡的贴条形码区,请保持条形码整洁、不污损。 2.选择题每小题选出答案后,用2B铅笔把答题卡上对应题目的答案标号涂黑,如需改动,用橡皮擦干净后,再选涂其它答案,答案不能答在试卷上。不按要求填涂的,答案无效。 3.非选择题必须用0.5毫米黑色字迹的签字笔作答,答案必须写在答题卡各题目指定区域内相应位置上,请注意每题答题空间,预先合理安排;如需改动,先划掉原来的答案,然后再写上新的答案;不准使用铅笔和涂改液。不按以上要求作答的答案无效。 4.考生必须保持答题卡的整洁,考试结束后,将答题卡交回。 Ⅰ语言知识及应用(共两节,满分45分) 第一节完形填空(共15小题;每小题2分,满分30分) 阅读下面短文,掌握其大意,然后从1~15各题所给的A、B、C和D中,选出最佳选项,并在答题卡上将该项涂黑。 One of the most important aspects of effective teamwork is effective leadership. This means that the team ____1_____ should have the skills to create a working culture that is___2_ , and in turn it will help to motivate. A good team leader also has to be able to _3_____ a high level of morale(士气) among the team members so that they feel _4______ and valued. When a team is created, there is purpose behind the _5_________ . Therefore, along with the reason for team creation, it’s als important that expectations from the team members are 6_______ marked out. The necessary resources in terms of people, money and time will have to be made 7____ to the team so that the team is able to meet the expectations. Individual team members will 8_____ their performance when managers or team leaders praise them highly. On the other hand, if someone on the team is not 9___ recognition, then they might become unhappy, and greatly reduce their productivity. However, no matter how good a team may be, conflicts will 10_____ occur some time or the other. The best way to counter(制止) this is to have proper methods of 11________ them. In fact, it is advisable for the team leader to actually sit with

相关文档
相关文档 最新文档