- 11
- 0
- 约2.87万字
- 约 7页
- 2017-06-14 发布于河南
- 举报
vb期末考试程序设计题
第一张:?4. 设计一个程序,实现加、减、乘、除运算,当单击“加法”命令按钮时,程序运行界面如图2.20所示。同样,单击其他命令按钮时,实现其他运算,等式中的运算符号要相应变化。
代码如下:
Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End Sub
?Private Sub Command2_Click()
Text3.Text = Val(Text1.Text) - Val(Text2.Text)
Label1.Caption = -
End Sub
?Private Sub Command3_Click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
Label1.Caption = *
End Sub
?Private Sub Command4_Click()
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
Label1.Caption = ÷
End Sub
第三章: 3. 计算下列分段函数值:
方法1) private sub command1_click()
Dim x As single ,y As single
X=val (Text 1.Text)
原创力文档

文档评论(0)