1. Im making a simple program with four text boxes on a form with four corresponding labels. Each label is a class i am taking.At the bottom is a command button. All i want is for the user to put his final grade in each of the text boxes and click the button to get their GPA.

If Text1.Text = 90 Then
int1TotalPoints = 45
ElseIf Text1.Text = 91 Then
int1TotalPoints = 45 ' 90 to 100 = 45 points
' 80 to 89 = 33.75

Is there anyway i can give 90 To 100 a value of 45 without this long coding?
Plus each TextBox can have anywhere from a Below 60 which is failing to 100 so how would i code this?
Thanxxxxxxx

2. I 'm not sure i understand exactly what do you mean.But if it's like i think .Try this
if text1.text &gt;=80 and text1.text &lt;90 then
int1TotalPoints = 33.75
elseif text1.text&gt;=90 and text1.text&lt;=100 then
int1TotalPoints = 45
endif

3. ahhhhhh yes. What was i thinking.
thanx.

4. Or... I prefer the CASE command as I find it easier to read and gives you more scope with multiple options. This this:-

Select Case Val(Text1.Text)
Case 90 To 100
int1totalpoints = 45
Case 80 To 90
int1totalpoints = 33.75
Case Else
int1totalpoints = 0
End Select

good Luck

5. why not just do something like this
GPA = (Val(text1) + Val(text2) + Val(text3) + Val(text4)) / 4

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•