用vb 设计程序:使用一个输出,使用label.使用两个单选按钮,一个caption是周长,一个是面积。
2个回答
展开全部
Private Sub Command1_Click()
Dim s As Double
r = Val(Text1.Text)
Const pi = 3.14159265
s = pi * r * r
Label1.Caption = "圆的面积为 " & s
End Sub
Private Sub Command2_Click()
Dim c As Double
r = Val(Text1.Text)
Const pi = 3.14159265
c = 2 * pi * r
Label2.Caption = "圆的周长为 " & c
End Sub
Dim s As Double
r = Val(Text1.Text)
Const pi = 3.14159265
s = pi * r * r
Label1.Caption = "圆的面积为 " & s
End Sub
Private Sub Command2_Click()
Dim c As Double
r = Val(Text1.Text)
Const pi = 3.14159265
c = 2 * pi * r
Label2.Caption = "圆的周长为 " & c
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim p
p = 3.1415
a = Val(InputBox("请输入圆的半径:"))
x = 2 * p * a
Label1.Caption = x
End Sub
Private Sub Command2_Click()
Dim p
p = 3.1415
a = Val(InputBox("请输入圆的半径:"))
x = p * a * a
Label1.Caption = x
End Sub
Dim p
p = 3.1415
a = Val(InputBox("请输入圆的半径:"))
x = 2 * p * a
Label1.Caption = x
End Sub
Private Sub Command2_Click()
Dim p
p = 3.1415
a = Val(InputBox("请输入圆的半径:"))
x = p * a * a
Label1.Caption = x
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询