Thursday, 22 March 2018

Calculation of Volume Lateral Surface Area and Total Surface Area of Cylinder

Public Class Form1
    Dim r, h, vol, lsa, tsa 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
        vol = PI * r * r * h
        lsa = 2 * PI * r * h
        tsa = 2 * PI * r * (r + h)
        TextBox3.Text = vol
        TextBox4.Text = lsa
        TextBox5.Text = tsa
    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.