i have some code as follows, where i am trying to loop a series of input boxes for the user to place marks for their assignments. this all happens when i click a button to enter marks for their assignments.
now what i cant get to happen no matter what i try is for each mark they put and and for each total, i dont know how to make them all add up in a textbox. Say they enter 45 for their mark, then 50 for marks possible for the assignment, then 45 again and 50 again, the program should stop as they have reached 100 then give them a high distinction. But this cannot happen as the code is not storing the 50 then the 50 again to add up to 100 then stop. It only goes 50 is not one hundred so go again. Can anyone help me here?
VB.NET:
Dim markIn As Integer
Dim total As Integer
Dim max As Integer
Dim grade As Integer
Dim mark As Integer
Dim mposs As Integer
max = 100
Do
markIn = InputBox("enter your mark for an assignment")
total = InputBox("enter the total marks possible for this assignment")
mark = Val(markIn)
mposs = Val(total)
Loop Until total >= max Or markIn > total
grade = Val(mark)
uiLabel6.Text = Val(grade)
uiLabel7.Text = Val(mposs)
If grade < 50 Then
MsgBox("you recieved a Fail")
ElseIf grade < 65 Then
MsgBox("you recieved a Pass")
ElseIf grade < 75 Then
MsgBox("you recieved a Credit")
ElseIf grade < 85 Then
MsgBox("you recieved a Distinction")
ElseIf grade > 85 Then
MsgBox("you recieved a High Distinction")
Else
MsgBox("Error")
End If