VB考前辅导班模拟考试卷ZBSJTDA.docVIP

  • 9
  • 0
  • 约7.92千字
  • 约 10页
  • 2017-03-15 发布于浙江
  • 举报
用输入对话框输入x,根据下式计算对应的y,并在窗体上输出y的值。 +sinx x10 ?y= 0 x=10 2x3+6 x10 程序写在命令按钮Command1的Click事件中。 参考答案: Private Sub Command1_Click() Dim x As Single , 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 mon

文档评论(0)

1亿VIP精品文档

相关文档