TonLocDotNet
Member
Im useing dbl in Dim,,,, do i realy have to ,,,,,,,, having problems with
calculation........... not to hard for most folks,,,,,,,,, but im just starting
to learn the basics...................thanks
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Declaring Variable to store input and output from users
Dim dbltxtTest1 As Double
Dim dbltxtTest2 As Double
Dim dbltxtTest3 As Double
Dim dbltxtAverage As Double
Dim txtLetterGrade
Calculate Average of three Test and Grade
dbltxtAverage = dbltxtTest1 + dbltxtTest2 + dbltxtTest3
txtAverage.Text = dbltxtAverage.ToString("###.##")
Determins Grade per Average
Select Case dbltxtAverage
Case 90 To 100
txtLetterGrade = "A"
Case 79 To 89
txtLetterGrade = "B"
Case 69 To 78
txtLetterGrade = "C"
Case 68 To 59
txtLetterGrade = "D"
Case Is < 59
txtLetterGrade = "F"
End Select
End Sub
calculation........... not to hard for most folks,,,,,,,,, but im just starting
to learn the basics...................thanks
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Declaring Variable to store input and output from users
Dim dbltxtTest1 As Double
Dim dbltxtTest2 As Double
Dim dbltxtTest3 As Double
Dim dbltxtAverage As Double
Dim txtLetterGrade
Calculate Average of three Test and Grade
dbltxtAverage = dbltxtTest1 + dbltxtTest2 + dbltxtTest3
txtAverage.Text = dbltxtAverage.ToString("###.##")
Determins Grade per Average
Select Case dbltxtAverage
Case 90 To 100
txtLetterGrade = "A"
Case 79 To 89
txtLetterGrade = "B"
Case 69 To 78
txtLetterGrade = "C"
Case 68 To 59
txtLetterGrade = "D"
Case Is < 59
txtLetterGrade = "F"
End Select
End Sub