Visual Basic程序设计(吉林医药学院)章节测试答案
2025年11月21日
在窗体上画一个命令按钮(名称为Command1),并编写如下代码: Function Fun1(ByVal a As Integer, b As Integer) As Integer Dim t As Integer t = a – b b = t + a Fun1 = t + b End Function Private Sub Command1_Click() Dim x As Integer x = 10 Print Fun1(Fun1(x, (Fun1(x, x – 1))), x – 1) End Sub 程序运行后,单击命令按钮,输出结果是( )。 11 21 0 10 A. B. C. D.
在窗体上画一个命令按钮(名称为C...
2025年11月21日
2025年11月21日
2025年11月21日
下列事件过程可以将打开对话框的标题改为”刑事案件卷宗”的是()。 Private Sub Command1_Click() ; CommonDialogl.DialogTitle=”刑事案件卷宗” CommonDialogl.Show End sub Private Sub Command1_Click() ; CommonDialogl.DialogTitle=”刑事案件卷宗” CommonDialogl.ShowColor End sub Private Sub Command1_Click() ; CommonDialogl.DialogTitle=”刑事案件卷宗” CommonDialogl.ShowOpen End sub Private Sub Command1_Click() ; CommonDialogl.Filter =”刑事案件卷宗” CommonDialogl.ShowSave End sub A. B. C. D.
下列事件过程可以将打开对话框的标...
2025年11月21日
以下是一个能返回数组a中最大数的函数过程代码: Functionmaxval(a()AsInteger)AsInteger ;text-indent:37px Dimmax% ;text-indent:37px max=1 ;text-indent:37px Fori=2To10 ;text-indent:75px Ifa(i)>a(max)Thenmax= i ;text-indent:37px Nexti maxval=max EndFunction Private Sub Command1_Click() Dim x(1 To 10) As Integer For i = 1 To 10 x(i) = Int(Rnd() * 100) Print x(i); Next i Print Print maxval(x()) End Sub 程序运行时,发现函数过程的返回值是错的需要修改,下面的修改方案中正确的是( )。 语句“maxval=max”应改为“maxval=a(max)” If语句“max=i”应改为“max=a(i)” 语句“max=1”应改为“max=a(1)” 语句“Fori=2To10”应改为“Fori=1To10” A. B. C. D.
以下是一个能返回数组a中最大数的...
2025年11月21日