I have a problem (this is for school), and I am stuck. This is from a similar post back from March, on the pythagorean Theorum or Cylinder Volume. I have the code entered and have no errors, but the only thing is when I run the calculate button when debugging, no matter what the numericUpDown buttons show, 1, 2, or 5 etc, my txtResult box still reflects 0. Can somebody please tell me what I am missing from my code? I'm so close I can almost taste it.
here is what I have so far on the calculate button:
Code:
Private Sub BtnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCalculate.Click
System.Convert.ToString(TxtResults.Text)
'step 1 - get input value from user
' 1a - get the value of A, or radius
Dim NUDRadOrDimA As Integer
Dim NudHeightOrB As Integer
' 1b - get the value of B, or the height
'step 2 - define the needed variables to the input values
'step 3 - determine which radio button was selected
If RdPythagorean.Checked Then
System.Math.Sqrt(NUDRadOrDimA ^ 2 + NudHeightOrB ^ 2)
'pythagorean Theorem calculation
'A^2 + B^2 = the length of the angle in the triangle (C^2)
'= pythagorean theorem
TxtResults.Text = (NUDRadOrDimA ^ 2 + NudHeightOrB ^ 2)
End If
If RdCylinder.Checked Then
'Cylinder volume calculation
'pi * (radius^2) * height = volume of a cylinder
'= cylinder volume
TxtResults.Text = (3.14 * ((NUDRadOrDimA ^ 2) * NUDHeightOrB))
End If
'step 4 - calculate the value based on above
'step 5 - display the output
End Sub
I appreciate any suggestions.
Thank you
Renee