Hi Community-
This place is awesome. Im really trying to get myself in to programming and always run into little walls that make me not want to push forward. I have spent the last few hours lookng at this code and can't figure why when I put these calculation is they output wrong.
What I am doing is simple. This is a basic Area and Perimeter calculator for triangles. Right now my formulas are entered wrong for simple troubleshooting. When I multiply 100 * 100 it gives me a return of 30,000 which is not what the answer is obviously. Does anyone perhaps see what I am doing wrong?
CODE
Public Class Form1
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtLength.TextChanged
End Sub
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim Width As Integer
Dim Length As Integer
Dim answerArea As Integer
Dim answerPerimeter As Integer
Width = CInt(txtWidth.Text)
Length = CInt(txtLength.Text)
answerArea = Width * Height
answerPerimeter = Width + Length
txtArea.Text = CStr(answerArea)
txtPerimeter.Text = CStr(answerPerimeter)
End Sub
End Class
Project is zipped and attached if needed.
Thank You kindly,
Christopher