题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-21 18:51:09

[单项选择]在窗体上画一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function f(m As Integer) If m Mod 2 = 0 Then f = m Else f = 1 End If End Function Private Sub Commandl Click( ) Dim i As Integer S = 0 For i=1 To 5 s = s + f(i) Next Print s End Sub 程序运行后,单击命令按钮,在窗体上显示的是
A. 11
B. 10
C. 9
D. 8

更多"在窗体上画一个名称为Command1的命令按钮,然后编写如下通用过程和"的相关试题:

[填空题]设计一个窗体,窗体上画一个名为Command1的命令按钮、一个名为CommonDialogl的通用对话框控件、一个名为Text1的文本框,利用“颜色”对话框将文本框中的字体颜色设置成用户所选择的颜色,为此编写以下程序代码,井按要求将程序补充完整。 Private Sub Command1_Click( ) CommonDialogl.Flags=cdlCCRGBInit CommonDialogl.Color=Text1.ForeColor 【9】 Text1.ForeColor=CommonDialog1.Color End Sub
[单项选择]在窗体上画一个名为Command1的命令按钮,其Command1_Click事件过程如下。
Sub Command1_Click( )
Dim student As studtype
Dim record_no As Integer
record n=1
With student
.ino=12
.strname="Smith"
.strsex=“男”
.smark=89
End With
______
Put # 1,record_no,student
Close # 1
End Sub
要求在c:/的随机文件student..dat写入一条记录。应在程序中空行处填入以下哪条语句使该功能完整
A. Open"c:/student.dat"For Input As # 1 len=len(student)
B. Open"c:/student.dat:For random As # 1 len=len(student)
C. Open"c:/student.dat"For Output As # 1 len=len(student)
D. Open"c:/student.dat"For Append As # 1 len=len(student)
[单项选择]在窗体上画一个名为Command1的命令按钮,然后编写如下程序: Option Base 1 Private Sub Command1_Click( ) Dim Arr Arr=Array(1,2,3,4,5) j = 1 For i=5 To 1 Step-1 S=S+Arr(i)*j j=j*10 Next Print S End Sub 程序运行后,单击命令按钮,输出结果为( )。
A. 54321
B. 123
C. 12345
D. 345
[单项选择]在窗体上画一个名为Command1的命令按钮,然后编写下列程序:

Option Base 1

Private Sub Command1_Click( )

Dim Arr

Arr=Array(1,2,3,4,5)

j=1

For i=5 To 1 Step-1

S=S+Arr(i)*j

j=j*10

Next

Print S

End Sub

程序运行后,单击命令按钮,输出结果是( )。
A. 54321
B. 123
C. 12345
D. 345
[单项选择]在窗体上画一个名为Command1的命令按钮,然后编写如下代码:
Option Base 1
Private Sub Command1_Click( )
Dim a
a=Array(1,2,3,4)
j=1
For j=4 To 1 Step-1
s=s+a(i)*j
j=j*10
Next i
Print s
End Sub
运行上面的程序,其输出结果是
A. 1234
B. 12
C. 34
D. 4321
[填空题]在窗体上画一个名为Command1的命令按钮,然后编写如下程序:
Private Sub Command1_Click( )
Dim i As Integer
Sum=0
n=InputBox("Enter a number")
n=Val(n)
For i=1 To n
Sum= (9)
Next i
Print Sum
End Sub
Function fun(t As Integer) As Long
p=1
For i=1 To t
p=p*i
Next i
(10)
End Function
以上程序的功能是:计算11 +2! +3!+…+n!,其中n从键盘输入,请填空。

[单项选择]在窗体上画一个名为Command1的命令按钮,然后编写以下程序:
Private Sub Command1_Click( )
Dim M(10) As Integer
For k = 1 To 10
M(k) = 12 - k
Next k
x=8
Print M(2 + M(x))
End Sub
运行程序,单击命令按钮,在窗体上显示的是( )。
A. 6
B. 5
C. 7 D) 8
[单项选择]在窗体上画一个命令按钮,名称为Command1。单击命令按钮时,执行如下事件过程:
Private Sub Command1_Click( )
  a$="software and hardware"
  b$=Right(a$,8)
  c$=Mid(a$,1,8)
  MsgBox a$,,b$,c$,1
End Sub
则在弹出的信息框的标题栏中显示的信息是( )。
A. software and hardware
B. software
C. hardware
D. 1
[单项选择]在窗体上画一个命令按钮,名称为Comraandl。单击该命令按钮时,执行如下事件过程:
Private Sub Command1_Click( )
a$="software and hardware"
b$=Right(a$, 8)
c$=Mid(a$, 1, 8)+b$
MsgSox a$, 1, b$
End Sub
则在弹出的消息框的标题栏中显示的信息是______。
A. software and hardware
B. software
C. hardware
D. 1
[单项选择]在窗体上画一个命令按钮,然后编写如下代码:
Private Type Record
ID As Integer
Name As String *20
End Type
Private Sub Command1_Click( )
Dim Maxsize, NextChar, MyChar
Open "d:/temp/female.txt" For Input As #1
Maxsize = LOF(1)
For NextChar = Maxsize To 1 Step -1
Seek #1, NextChar
MyChar = Input(1, #1)
Next NextChar
Print EOF(I)
Close 31
End Sub
程序运行后,单击命令按钮,其输出的结果为
A. True
B. False
C. 0
D. Null
[单项选择]在窗体上画一个命令按钮,然后编写如下程序。运行后,单击命令按钮,输出结果为 ( )。
Private Sub Command4_Click( )
Dima As Integer,bASInteger
a=1
b=2
PrintN(a,b)
End Sub
Function N(X As Integer,yAsInteger)AsInteger
N=IIf(x>y,x,y)
End Funcfion

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码