電腦程式 作業二 酸雨測試
http://st2.fju.edu.tw/~a9133137/homework_2.exe
這是這次電腦程式作業
程式碼如下:
Private Sub Command1_Click()
Sum = names
For i = 1 To Text1.Text
names = InputBox("input value PH:", "PH值", "1")
Sum = Val(Sum) + Val(names)
Next i
Text2.Text = Sum / Text1.Text
If Sum / Text1.Text = 7 Then
Text3.Text = "中性"
End If
If Sum / Text1.Text < 7 Then
Text3.Text = "是"
End If
If Sum / Text1.Text > 7 Then
Text3.Text = "否"
End If
If Sum / Text1.Text < 0 Or Sum / Text1.Text > 14 Then
Label4.Caption = "平均之PH值不正確,請重新執行!"
End If
End Sub
Private Sub Command2_Click()
End
End Sub
--
※ 發信站: 批踢踢實業坊(ptt.csie.ntu.edu.tw)
◆ From: 140.136.238.13