一个大学vb题,非计算机专业? 50
3个回答
展开全部
Dim distance
Private Sub Command1_Click()
distance = InputBox("请输入行驶里程数:")
End Sub
Private Sub Command2_Click()
If distance > 0 And distance <= 4 Then
Text1.Text = 10
ElseIf distance > 4 And distance <= 15 Then
Text1.Text = 10 + (distance - 4) * 1.2
ElseIf distance > 15 Then
Text1.Text = 10 + (distance - 4) * 1.2 + (distance - 15) * 1.8
End If
End Sub
Private Sub Command1_Click()
distance = InputBox("请输入行驶里程数:")
End Sub
Private Sub Command2_Click()
If distance > 0 And distance <= 4 Then
Text1.Text = 10
ElseIf distance > 4 And distance <= 15 Then
Text1.Text = 10 + (distance - 4) * 1.2
ElseIf distance > 15 Then
Text1.Text = 10 + (distance - 4) * 1.2 + (distance - 15) * 1.8
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询