Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Area of a Triangle using VB.Net - Basic Programming, Exercises of Computer Engineering and Programming

Simple code for finding area of a triangle using VB.Net

Typology: Exercises

2015/2016

Uploaded on 08/24/2016

dhanvine
dhanvine 🇮🇳

3.8

(4)

40 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Find the area of a triangle using VB
Program Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
TextBox2.Text = 3.14 * TextBox1.Text
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
TextBox5.Text = TextBox3.Text * TextBox4.Text
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
Dim a As Integer = TextBox6.Text
Dim b As Integer = TextBox7.Text
Dim c As Integer = TextBox8.Text
Dim s As Double = (a + b + c) / 2
Dim findarea As Double = Math.Sqrt(s * (s - a) * (s - b) * (s - c))
TextBox9.Text = findarea
End Sub
End Class

Partial preview of the text

Download Area of a Triangle using VB.Net - Basic Programming and more Exercises Computer Engineering and Programming in PDF only on Docsity!

Find the area of a triangle using VB

Program Code:

Public Class Form Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox2.Text = 3.14 * TextBox1.Text End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox5.Text = TextBox3.Text * TextBox4.Text End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim a As Integer = TextBox6.Text Dim b As Integer = TextBox7.Text Dim c As Integer = TextBox8.Text Dim s As Double = (a + b + c) / 2 Dim findarea As Double = Math.Sqrt(s * (s - a) * (s - b) * (s - c)) TextBox9.Text = findarea End Sub End Class