0% found this document useful (0 votes)
65 views

Public Class Form2

This code defines a class that takes in a percentage score from a text box, converts it to a letter grade, and displays the grade in another text box. It declares a percentage variable, a button click event handler that gets the percentage, uses a select case statement to assign a letter grade based on ranges of percentages, and outputs the grade to the second text box.

Uploaded by

api-347017345
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Public Class Form2

This code defines a class that takes in a percentage score from a text box, converts it to a letter grade, and displays the grade in another text box. It declares a percentage variable, a button click event handler that gets the percentage, uses a select case statement to assign a letter grade based on ranges of percentages, and outputs the grade to the second text box.

Uploaded by

api-347017345
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Public Class Form1

Dim Precent As Integer


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Precent = TextBox1.Text

Select Case Precent


Case Precent = 0 To 50
Me.TextBox2.Text = "F"

Case Precent = 50 To 59
Me.TextBox2.Text = "D"

Case Precent = 60 To 66
Me.TextBox2.Text = "C"

Case Precent = 67 To 72
Me.TextBox2.Text = "C+"

Case Precent = 73 To 85
Me.TextBox2.Text = "B"

Case Precent = 86 To 100


Me.TextBox2.Text = "A"
End Select

End Sub
End Class

You might also like