有如下事件过程: Private Sub Command1_Click() b=10 Do Until b=-1 a=InputBox("请输入a的值") a=Val(A) b=InputBox("请输入b的值") b=Val(b) a=a * b Loop Print a End Sub 程序运行后,依次输入数值30,20,10,-1,输出结果为
单击命令按钮时,下列程序的执行结果为 Private Sub Command1_Click() Dim x As Integer, y As Integer x=50: y=78 Call PPP(x, y) Print x; y End Sub Public Sub PPP(ByVal n As Integer, ByVal m As Integer) n=n \ 10 m=m \ 10 End Sub
单击按钮时,以下程序运行后的输出结果是 Private Sub proc1(x As Integer, y As Integer, z As Integer) x=3 * z y=2 * z z=x + y End Sub Private Sub Command1_Click() Dim x As Integer, y As Integer, z As Integer x=1: y=2: z=3 Call proc1(x, x, z) Print x; x; z Call proc1(x, y, y) Print x; y; y End Sub
单击命令按钮时,下列程序的运行结果为 Private Sub Command1_Click() Print MyFund(20, 18) End Sub Public Function MyFund(m As Integer, n As Integer) As Integer Do While m <> n Do While m > n: m=m - n: Loop Do While m < n: n=n - m: Loop Loop MyFund=m End Function
以下程序的功能是从键盘输入若干个学生的考试成绩,统计并输出最高分和最低分,当输入负数时结束输入,输出结果。请补充完整下列程序段。 Dim x, amax, amin As Single x=InputBox("Enter a score") amax=x amin=x Do While __ If x > amax Then amax=x End If If __ Then amin=x End If x=InputBox("enter a score") Loop Print "max="; amax, "min="; amin
以下是一个计算矩形面积的程序,调用过程计算矩形面积,请将程序补充完整。 Sub RecArea(L, W) Dim S As Double S=L * W MsgBox "Total Area is " & Str(S) End Sub Private Sub Command1_Click() Dim M, N M=InputBox("What is the L?") M=Val(M) __ N=Val(N) __ End Sub
有一个事件过程,其功能是:从已存在于磁盘上的顺序文件NM1.txt中读取数据,计算读出数据的平方值,将该数据及其平方值存入新的顺序文件NM2.txt中。请填空。 Private Sub Form_Click() Dim x As Single, y As Single Open "NM1.txt" For Input As #1 Open "NM2.txt" For Input As #2 Do While Not EOF(1) __ Print x y=x ^ 2 __ Print y Loop Close #1, #2 End Sub