Public Class Form1
Dim r, h, l, csa, tsa, vol As Single
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Const PI As Single = 3.142
r = TextBox1.Text
h = TextBox2.Text
l = (r ^ 2 + h ^ 2) ^ (1 / 2)
csa = PI * r * l
tsa = PI * r * (r + l)
vol = (PI * r * r * h) / 3
TextBox3.Text = l
TextBox4.Text = csa
TextBox5.Text = tsa
TextBox6.Text = vol
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
No comments:
Post a Comment
Note: only a member of this blog may post a comment.