Making Value Converter Into Letter

  1. Create new  project
  2. Prepare the items :

Label

Properties :

Text :value

 

textbox

Properties :

name :txtvalue

 

button

Properties :

Text :convert

Name:btconvert

 

Label2

  1. Click twice into btconvert ,  Type source code below :

Public Class Form1

Dim a As Integer

Dim b As String

Private Sub btconvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btconvert.Click

a = Val(CInt(txtvalue.Text))

If a > 80 And a <= 100 Then

b = "A"

ElseIf a > 70 And a <= 80 Then

b = "B"

ElseIf a > 60 And a <= 70 Then

b = "C"

ElseIf a > 50 And a <= 60 Then

b = "D"

ElseIf a > 0 And a <= 50 Then

b = "E"

Else

b = "OUT OF RANGE"

End If

Label2.Text = b

End Sub

End Class

4.   Run the program (F5)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: