首页/ 题库 / [单选题]下列程序 Private Sub for的答案

下列程序 Private Sub form_Click() score=Int(Rnd * 10)+80 Select Case score Case Is<60:a$="F" Case 60 To 69:a$="D" Case 70 To 79:a$="C" Case 80 To 89:a$="B" Case Else:a$="A" End Select Print a$ End Sub 运行时输出的结果是

单选题
2022-01-04 10:03
A、F
B、D
C、C
D、B
查看答案

正确答案
D

试题解析
解析:本题计算score用的表达式是Int(Rnd*10)+80,由于Rnd产生0到1之间的随机数,该随机数含。但不含1,乘10取整后其值是。到9之间的整数,加80后值是80到89之间的整数,多分支入口select Case score,测试表达式是score,从上到下检查Case中的表达式列表是否满足条件,本题中Case 80 To 89表达式满足条件,因此执行a $="B",a$的值执行后为字符B,退出多分支后,输出字符B。

标签:
感兴趣题目
下列程序运行时输出的结果是( )。 Option Base 1 Private Sub Form_Click() Dimx(10)As Integer,y(5) As Integer ForI=1 to 10 x(i)=10-I+1 NextI ForI=1 to 5 y(i)cx(2*-1)+x(2*I) NextI ForI=1 to 5 Printy(i); NextI
下列程序运行时输出的结果是( )。 Option Base 1 Const a=10 Private Sub Form_Click() Dim x(a)As Integer k=-1 For i=1 To a x(i)=i*k k=(-1)*k Next i For i=1 To 10 Print x(i) Next i End Sub
下面程序段的运行结果是( )。 Private Sub Form_Click() For I=3 to 1 step-1 Print Spc(10-I); For j=1 to 2*I-1 print"*"; Next j Print Next I End Sub
有如下程序: Private Sub Form_Click() E=1:F=1 For i=1 To 3 E=E+F:F=F+E Next Print E;F End Sub 该程序的输出结果是
有如下程序: Private Sub Form_Click() E=1:F=1 For j=1 To 3 E=E+F:F=F+E Next Print E:F End Sub 该程序的输出结果是
函数Int(Rnd()*100)是下列哪个范围的整数?()。
下列程序的执行结果是( )。 Privaae Sub Form_Activate Dim score(3)As Integer,total As Integer Dim aa_score As Variant score(1)=50:score(2)=14:score(3)=36 total=0:i=0 For Each aa_score In score i=i+1 total=total+aa_score Print i,aa_score,total Next End Sub
下面程序运行结果是( )。 Private Sub Form_Click() Dim x As Single,y As Single x=InputBox("请输入数据25"):y=InputBox("请输入数据10") Print x+y;InputBox("请输入数据25")+InputBox("请输入数据10") End Sub
下面程序执行的结果是( )。 Private Sub Form_Click() AS="123":B$="456" C=Val(A$)+Val(B$) Print C100 End Sub
阅读程序: Option Base 1 Private Sub Form_Click( ) Dim arr,Sum Sum=0 arr=Array(1,3,5,7,9,11,13,15,17,19) For i=1 To 10 If arr(i)/3=arr(i)3 Then Sum=Sum+arr(i) End If Next i Print Sum End Sub程序运行后,单击窗体,输出结果为
当下面程序运行后,单击窗体在对话框中输入10,则输出的结果是() Private Sub Form_Click() score=InputBox("输入") Select Case score CaseIs<10 a$="F" Case 10 To 19 a$="D" Case 20 To 29 a$="C" Case 30 To 39 a$="B" Case Else a$="A" End Select Printa$ End Sub
下列程序段运行后输出的结果是()。 Private Sub Form_Click Dim X#, Y# X = 5: Y = 6 Print X + Y = 11 End Sub
相关题目
函数Int(Rnd*11+10)的值的范围是_______。
以下程序的运行结果是( )void sub (int x,int y,int z){z=y-x;}main(){int a,b,c;sub(10,5,&a);sub(7,a,&b);sub(a,b,&c);printf(%4d,%4d,%4d,a,b,c);}
有如下程序: Private Sub Form_Click() Dim i As Integer, Sum As Integer sum=0 For i=2 To 10 If i Mod 2<>0 And i Mod 3=0 Then sum=sum+i End If Next i Print sum End Sub 程序运行后,单击窗体,输出结果为______。
有如下程序: Private Sub Form_Click( ) Dim i As Integer, Sum As Integer Sum = 0 For i = 2 To 10 If i Mod 2=0 And i Mod 3<>0 Then Sum = Sum + i End If Next Print Sum End Sub 程序运行后,单击窗体,输出结果为
有如下程序: Private Sub Form_Click() Dim i As Integer,Sum As Integer Sum=0 For i=2 To 10 If i Mod 2<>0 And i Mod 3=0 Then Sum=Sum+i End If Next Print Sum End Sub 程序运行后,单击窗体,输出结果为
阅读程序: Option Base 1 Private Sub Form_Click() Dim art,Sum Sum=0 art=Array(1,3,5,7,9,11,13,15,17,19) For i=1 To 10 If arr(i)/3=arr(i)3 Then Sum=Sum+art(i) End If Next i Pdnt Sum End Sub 程序运行后,单击窗体,输出结果为( )。
下面程序执行时,输出的结果是( )。 Private Sub Form_Click() DimiASInteger,j As Integer i=10 Do i=i+j forj=10 toistep-3 i=i+j nextj Loop Whilei<50 Printi;j End Sub
编写如下程序: Private Sub Form_Click() a$="54321":b$="abcde" For j=1 To 5 Print Mid$(a$,6-j,1)+Mid$(b$,j,1); Next j Print End Sub 程序运行后,单击窗体,其输出结果为 ______。
下列程序运行时输出的结果是 Option Base 1 Private Sub Form_Click() Dim x(10) As Integer,y(5) As Integer For i=1 to 10 x(i)=10-i+1 Next For i=1 to 5 y(i)=x(2*i-1)+x(2*i) Next For i=1 to 5 Print y(i) Next End Sub
下列程序运行时输出的结果是 Option Base 1 Private Sub Form_Click() Dim x (10)As Integer,y(5)As Integer For i=1 to 10 x(i)=10-i+1 Next For i=1 to 5 y(i)=x(2*i-1)+x(2*i) Next For i=1 to 5 Print y(i) Next End Sub
下列程序 Private Sub form_Click() score=Int(Rnd * 10)+80 Select Case score Case Is<60:a$="F" Case 60 To 69:a$="D" Case 70 To 79:a$="C" Case 80 To 89:a$="B" Case Else:a$="A" End Select Print a$ End Sub 运行时输出的结果是
在窗体中添加一个命令按钮(其Name属性为Command1),然后编写如下代码: Pfivme Sub Command1_Click( ) score=Iht(Rnd*10)+70 Select Case score Case ls<60 a$=“F” Case 60 T069 a$=“D” Case 70 To 79 a$=“C” Case 80 To 89 a$=“B” Case Else a$=“A” End Select Print aS End Sub 程序运行后,单击命令按钮,输出结果是
执行下列程序后,鼠标单击窗体,输出结果为 Private Sub Form_Click() Print"Click": End Sub Private Sub Form_MouseDown(Button As Integer,Shift_As Integer,X As Single,Y As Single) Print"Donw" End Sub Private Sub Form_MouseUp(Button As Integer,Shift_As Integer,X As Single,Y As Single) Print"Up" End Sub
执行下列程序后,鼠标单击窗体,输出结果为。 Private Sub Form_Click() Print“Click”; End Sub Private Sub Form_MouseDown(Button As Integer,Shift_ As Integer,X As Single,Y As Single) Print “Donw” End Sub Private Sub Form_MouseUp(Button As Integer,Shift_ As Integer,X As Single,Y As Single) Print“Up” End Sub
下列程序的运行结果是 Private Sub Form_Click() Dim k As Integer n=5 m=1 k=1 Do m=m+2 k=k+1 Loop Until k>n Print m End Sub
表达式Int(Rnd(0)+1)+Int(Rnd(1)-1)的值为( )。
表达式Int(5*Rnd+1)*Int(5*Rnd-1)值的范围是()
函数Int(Rnd(0)*100)是下列( )范围内的整数。
表达式Int(Rnd*71)+10产生的随机整数范围是()。
下列程序运行时输出的结果是( )。 Option Base 1 Private Sub Form_Click() Dimx(10) ForI=1 to 10 x(i)=10-I+1 Next I ForI=10 to 1 step-2 Printx(i); NextI End Sub
广告位招租WX:84302438

免费的网站请分享给朋友吧