当两电阻R1=20Ω,R2=30Ω并联时,其总电阻为()。
第1题:
当执行以下过程时,在名为lblResult的标签框内将显示______。Private Sub Command1_ Click() Dim I, R R = 0 for I = 1 To 5 step 1 R= R+ I Next I lblResult. Caption = Str$(R)End Sub
A.字符串15
B.整数15
C.字符串5
D.整数5
第2题:
在窗体上画一个命令按钮,然后编写如下程序: Sub S1(By Val x As Integer, By Val y As Integer) Dim t As Integer t=x x=y y=r End Sub Private Sub Command1_Click() Dim a As Integer, b As Integer a=10 b=30 S1 a,b Print"a=";"b=";b End Sub 程序运行后,单击命令按钮,.输出结果是______。
A.a=30 b=10
B.a=30 b=30
C.a=10 b=30
D.a=10 b=10
第3题:
以下程序用来输出20个在开区间(10,87)上的随机整数数R,每行输出4个整数。请完成空白处.
Private Sub Commandl. Click( )
For I=1 To 10
R = Int (Rnd * 76 + 11)
Print R;
If【 】Then Print
Next I
End Sub
第4题:
写出程序运行的结果
Public class Base
Public virtual string Hello() {return “Base”;}
Public class Sub:Base
Public override string Hello() {return “Sub”;}
1. Base b = new Base(); b.Hello;
2. Sub s = new Sub(); s.Hello;
3. Base b = new Sub (); b.Hello;
4. Sub s = new Base(); s.Hello;
第5题:
以下程序用来输出20个在开区间(10,87)上的随机整数R,每行输出4个整数。请完成空白处。
Private Sub Command1 Click()
For I=1 To 10
R=Int(Rnd*76+11)
Print R;
If【 】Then Print
Next I
End Sub
第6题:
在窗体中添加一个标签LblResult和一个命令按钮Command1,然后编写程序。程序的功能是单击命令按钮,计算1+2+3+4+5的值,并把结果转化为字符串显示在标签内,能够实现上述功能的程序段是, ( )
A.Private Sub Command1_Click() Dim I,R As Integer For I=1 To 5 Step 1 R=R+I Next LblResult. Name=Str$ (R) End Sub
B.Private Sub Command1_ClickO Dim I,R As Integer For I=1 To 5 Step 1 R=R+I Next LblResult. Caption= Str$ (R) End Sub
C.Private Sub Command1_Click() Dim I,R As Integer Do While I<5 R=R+I I=I+1 Loop LblResult. Caption=Str$ (R) End Sub
D.Private Sub Command1_Click() Dim I,R As Integer Do R=R+I I=I+1 Loop While I<5 LblResult. Caption=Str$ (R) End Sub
第7题:
【程序说明】 计算下列算式的值。a,Ai为正整数,从键盘输入。其小∑Ai=1+2…+ Ai,Ai!=1 *2*3*Ai(i=1,2… a)。
【程序】
SET TAIK OFF
CLEAR
INPUT“M=”TO M
STORE 0 TO S1,S2
FOR I=1 TO M
(8)
DO SUB1
DO SUB2
ENDFOR
? ” 所求算式的值为:“+ALLTRIM(STR(S1/S2,15,3))
SET TALK ON
PROCEDURE SUB1
(9)
FOR R=1 TO A
K=K+R
ENDFOR
(10)
RETURN
PROCEDURE SUB2
(11)
FOR P=1 TO A
T=T*P
ENDFOR
(12)
RETURN
(8)
A.INPUT“A=”TO A
B.INPUT“I=”TO I
C.INPUT“R=”TO STR(R)
D.INPUT“K=”TOK
第8题:
在窗体中添加一个名称为Command1的命令按钮,然后编写如下程序: Public x As Integer Private Sub Command1_Click() x=10 Call s1 Call s2 MSgBox x End Sub Private Sub s1() x=x+20 End Sub Private Sub s2() Dim x As Integer x=X+20 End Sub 窗体打开运行后,单击命令按钮,则消息框的输出结果为______。
A.10
B.30
C.40
D.50
第9题:
编写如下事件过程: Private sub sub1 (ByVal x1 As String, y1 As String) Dim xt As String Dim i As Integer i = Len(x1) Do While i>= 1 xt = xt + Mid(x1, i, 1) i=i-1 Loop y1 = xt End Sub Private Sub Form. Click() Dim s1 As String, s2 As String s1= "teacher" sub1 s1, s2 Print s2 End Sub 程序运行后,单击窗体,则窗体上显示的内容是
A.rehcaet
B.tahreee
C.themee
D.eerthea
第10题:
在窗体中添加一个名称为Commandl的命令按钮,然后编写如下程序: Public x As Integer Private Sub Commandl_click() x=10 Call s 1 Call s 2 MsgBOx x End Sub Pfivate Sub s1() x=x+20 End Sub Private Sub
A.10
B.30
C.40
D.50