- 13
- 0
- 约8.58万字
- 约 12页
- 2016-12-09 发布于河南
- 举报
自编程序设题参考答案
用输入对话框输入x,根据下式计算对应的y,并在窗体上输出y的值。
+sinx x10
?y= 0 x=10
2x3+6 x10
程序写在命令按钮Command1的Click事件中。
参考答案:
Private Sub Command1_Click()
Dim x As Single
Dim y As Single
x = Val(InputBox(please input a number))
Select Case x
Case Is 10
y = Sqr(x) + Sin(x)
Case Is = 10
y = 0
Case Is 10
y = 2 * x ^ 3 + 6
End Select
Print y
End Sub
编写一个程序,根据上网时间计算上网费用,上机时间用输入对话框输入。公式如下:
同时,为了鼓励多上网,每月最多不超过600元。
参考答案:
Private Sub Command1_Click()
Dim times As Single, money As Single
times = Val(InputBox(please input a number))
Select Case times
Case Is 10
原创力文档

文档评论(0)