试题

试题 试卷

logo

题型:综合题 题类:常考题 难易度:困难

浙江省东阳中学2015-2016学年高一下学期信息技术期中考试试卷

编写VB程序,实现如下功能:在文本框Text1中输入某一年份,单击“天干地支与生肖”按钮Command1,在列表框List1中输出该年份开始的12个年份及对应的“天干地支”与“生肖”,运行界面如图所示,程序代码如下。2

(1)、代码“Private Sub Command1_Click()”中的Click是       。(单选,填字母)
A、对象名 B、属性名 C、事件名
(2)、为实现上述功能,请在划线处填入合适的代码。

Private Sub Command1_Click()

Dim a As Integer, b As Integer

Dim i As Integer, n As Integer

Dim c1 As String, s1 As String

Dim c2 As String, s2 As String

Dim c3 As String, s3 As String

List1.Clear

s1 = "甲乙丙丁戊己庚辛壬癸"

s2 = "子丑寅卯辰巳午未申酉戌亥"

s3 = "鼠牛虎兔龙蛇马羊猴鸡狗猪"

n = Val(Text1.Text)

For i = n To

   a = (i + 6) Mod 10

   b = (i + 8) Mod 12

   c1 = Mid(s1, a + 1, 1)

   c2 = Mid(s2, b + 1, 1)

   c3 = Mid(s3, b + 1, 1)

   List1.AddItem + "年" + c1 + c2 + " " + c3

Next i

End Sub

(3)、由上述算法可知,2024年对应的“天干地支”为
举一反三
返回首页

试题篮