Dim x as integer,y as integer
x=3
y=4
Text1.Text=“x+y”
该程序运行后,文本框Text1中显示的为( )
Private Sub Commandl_Click()
Dim a As String
a ="r"
a=Chr(Asc(a) - 4)
Label1. Caption =a
End Sub
运行程序后, Label1中的显示结果为( )
n =Val(Text1. Text)
s=0
Do While n <> 0
x = n Mod 10
s=x+s
n=n\10
Loop
在文本框Text1中输入“20201119”,执行该程序段后,s的结果为( )
图1 |
(计算公式为:生活用水占淡水资源总量的百分比(%)=2010-2018年度淡水抽取量占水资源总量百分比(%)×生活用水利用(%)/100)
图2 |
图3 |
程序界面如图1所示,在本框Text1中输入COD指标,单击“计算投放量”按钮(Command1)后,程序根据COD指标计算出合适的COD去除剂投放量,并在标签Label3中输出计算结果。
污水处理厂根据COD指标投放COD去除剂的标准如下表所示:
当前COD指标X |
根据COD指标应投放COD去除剂的剂量 |
X<50 |
10 |
X≥50并且X≤500 |
|
X>500 | 3X |
图 1
图2 |
Private Sub Command1_Click( )
Dim x As Single,s As Single
x =Val(Text1. Text)
If x < 50 Then
s=10
ElseIf
Else
s=3*x
End If
Label3. Caption=
End Sub
图1 |
Private Sub cmd_Click( )
Dim a1 As Integer, a2 As Integer, flag As Boolean
Dim s As String, c As String, i As Integer, n As Integer
a1 =0: a2 =0: flag =False
s=Text1.Text
n =Len(s)
i=1
Do While
c =Mid(s, i. 1)
If Then
a1=1
Elself c > = "0" And c < = "9" Then
a2=1
End If
If Then flag =True
i=i+1
Loop
If flag And n >=8 Then
Label2. Caption="验证结果:符合要求"
Else
Label2. Caption="验证结果:不符合要求"
End If
End Sub