This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Handles btnCalculate.Click Dim MdSpeed As Decimal Dim wvTravelDist As Decimal Try wvTravelDist = CDec(txtDistance.Text) 'TextBox entry is a Number Catch ex As Exception MessageBox.Show("You Must Enter a Number" & CrLf & "For The Distance" & _ CrLf & "The Sound Traveled.", "Input Error!") End Try If txtDistance.Text <= 0 Then 'TextBox lessThan 0 MessageBox.Show("Distance Traveled" & CrLf & _ "Can Not Be Zero or Less Than Zero " & CrLf & CrLf & _ "Please Try again!", "Input Error - Distance Traveled!") End If If rdoAir.Checked Then MdSpeed = SpdAir ElseIf rdoWater.Checked Then MdSpeed = spdWater ElseIf rdoSteel.Checked Then MdSpeed = spdSteel Else MessageBox.Show("You Must Select A Medium", "Input Error!") End If lblTrvlTime.Text = FormatNumber((wvTravelDist / MdSpeed), 3) & " Seconds" End Sub End Class End The Program Source Code Extensive Editing was necessaryonce I loaded it into the Blog....
View Full Document
This note was uploaded on 10/23/2011 for the course COP 1332 taught by Professor Ryland during the Spring '11 term at American College of Computer & Information Sciences.
- Spring '11