题目内容 (请给出正确答案)
[主观题]

有如下程序: Private Sub Command1_Click() xcase = 1 t = InputBox("请输入一个数:") Select Ca

有如下程序: Private Sub Command1_Click() xcase = 1 t = InputBox("请输入一个数:") Select Case t Case Is > 0 y = xcase + 1 Case Is = 0 y = xcase + 2 Case Else y = xcase + 3 End Select Print xcase; y End Sub 程序运行时,在对话框中输入-1,则显示的结果为()。

A、1 4

B、1 3

C、1 2

D、1 1

暂无答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“有如下程序: Private Sub Command1_Cl…”相关的问题

第1题

在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:

Dim SW As Boolean

Function func(X As Integer)As Integer

If X<20 Then

Y=X

Else

Y=20+X

End If

func=Y

End Function

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

SW=False

End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

SW=True

End Sub

Private Sub Command1_Click()

Dim intNum As Integer

intNum=InputBox("")

If SW Then

Print func(intNum)

End If

End Sub

程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为

A.输出0

B.输出25

C.输出45

D.无任何输出

点击查看答案

第2题

在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:

Dim SW As Boolean

Function func(X As Integer) As Integer

If X < 20 Then

Y = X

Else

Y = 20 + X

End If

func = Y

End Function

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

SW = False

End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

SW = True

End Sub

Private Sub Command1_Click()

Dim intNum As Integer

intNum = InputBox("")

If SW Then

 Print func(intNum)

End If

End Sub

程序运行后,单击命令按钮,将显示一个输入对话框,如果在输入对话框中输入25,则程序的执行结果为( )。

A.输出0

B.输出25

C.输出45

D.无任何输出

点击查看答案

第3题

在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func=Y End Function Private Sub Form_MouseDown(Button As Integer,_Shift As Integer,X As Single,Y As Single) SW=False End Sub Private Sub Form_MouseUp(Button As Integer,_Shift As Integer,X As Single,Y As Single) SW=True End Sub Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox("") If SW Then Print func(intNum) End If End Sub 程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为

A.输出0

B.输出25

C.输出45

D.无任何输出

点击查看答案

第4题

在窗体上有一个命令按钮,然后编如下事件过程:

Function SR(x As Double) As Double

Select Case Sgn(x)

Case 1

SR=Sqr(x)

Exit Function

Case 0

SR=0

Case -1

SR=-1

End Select

End Function

Private Sub Command1_Click()

Dim Msg, SRN

Dim N As Double

N=InputBox("请输入要计算平方根的数")

Msg=N & "的平方根"

Select Case SR(N)

Case 0

Msg=Msg & "是0"

Case -1

Msg=Msg & "是一个虚数"

Case Else

Msg=Msg & "是" & SR(N)

End Select

MsgBox Msg

End Sub

程序运行后,单击命令按钮,在输入对话框内输入-1,输出结果是 【15】 。

点击查看答案

第5题

在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:

Dim SW As Boolean

Function func(X As Integer) As Integer

If X<20 Then

Y=X

Else

Y=20+X

End If

func=Y

End Function

Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)

SW=False

End Sub

Pdvate Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)

SW=True

End Sub

Private Sub Command1_Click()

Dim intNum As Integer

intNum=InputBox("")

If SW Then

Print func(intNum)

End If

End Sub

程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为

A.输出0

B.输出25

C.输出45

D.无任何输出

点击查看答案

第6题

在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Dim SW As Boolean Function func(X As Integer)As Integer IfX<20 Then Y=X Else Y=20+X End lf func=Y End Function Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) SW=False End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As SinSle,Y As Single) SW=True End Sub Prinvate Sub Command1_Click( ) Dim intNum As Integer intNum=InputBox(””) If SW Then Print func(intNum) End If End Sub 程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为

A.输出0

B.输出25

C.输出45

D.无任何输出

点击查看答案

第7题

在窗体上画一个名称为Coramandl的命令按钮,然后编写如下程序; Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func=Y End Function Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim a As Boolean SW=False End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) SW=True End Sub Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox("") If SW Then Print flmc(intNum) End If End Sub 程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为

A.输出0

B.输出2

C.输出45

D.无任何输出

点击查看答案

第8题

在窗体上画一个名称为Commana1的命令按钮,然后编写如下程序: Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func = Y End Function Private Sub Form. MouseDown(Button As Integer,_ Shift As Integer,X As Single, Y As Single) SW = False End Sub Private Sub Form_MouseUp( Button As Integer,_ Shift As Integer ,X As Single, Y As Single) SW = True End Sub Private Sub Commandl_Click( ) Dim intNum As Integer intNum = InputBox(" ") If SW Then Print func(intNum) End If End Sub 程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为

A.输出0

B.输出25

C.输出45

D.无任何输出

点击查看答案

第9题

阅读下列程序: Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func=Y End Function Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=False End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=True End Sub Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox(" ") If SW Then Print func(intNum) End If End Sub 程序运行后,单击一次窗体,再单击命令按钮,将显示一个输入对话框,如果在对话框中输入20,则程序的输出结果为

A.0

B.20

C.40

D.无任何输出

点击查看答案

第10题

设在工程中有一个标准模块,其中定义了如下记录类型 Type Books Name As String*10 TelNum As String*20 End Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_Click时,在顺序文件 Person.txt中写入一条记录。下列能够完成该操作的事件过程是

A.Private Sub Command1_Click( ) Dim B As Books Open”c:\PerSon.txt"For Output As #1B.Name=InpuB。x(“输入姓名”)B.TelNuln=InputBox(“输入电话号码”) Wdte#1.B.Name,B.TelNum Close#1 End Sub

B.PIivate Sub Command1_C1ick() Dim B As BOOks OPen”c:\Person.txt"FOr lnput As #1 B.Name:InputBox(“输人姓名”) B.TelNum=InputBox(“输入电话号码”) Print#1,B.Name,B.TelNum C1ose#1 End Sub

C.Private Sub Command1_Chck( ) Dim B As Books Open”c:\Person.ht”For Output As#1 B.Name=InputBox(“输入姓名”) B.TelNum=InputBox(“输入电话号码”) Write#1,B Close#1 End Sub

D.Pnvate Sub Command1_Click( ) Open”c:\Person.txt"For lnput As #1 Name=InputBox(“输入姓名”) TalNum=InputBox(“输入电话号码”) Print,Name,TelNum Close#1 End Sub

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,
如果您知道正确答案,欢迎您来纠错

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信