Microsoft Small Basic

Program Listing: NMF299
eqstart:
Grade=""
RAW=0
total=100
percentage=0
TextWindow.WriteLine("What is your name?")
name = TextWindow.Read()
gradestart:
TextWindow.WriteLine("What is the name of the subject?, "+name)
subject = TextWindow.Read()
TextWindow.WriteLine("What is your score in "+subject+"?, " +name)
RAW = TextWindow.ReadNumber()
TextWindow.WriteLine("what is your highest possible score in the "+subject+" activity " +name+"?")
total = TextWindow.ReadNumber()
percentage = (RAW/total)*50+50
TextWindow.WriteLine(percentage)

IF (percentage < 75) Then
Grade="U"
ElseIf (percentage >= 75 and percentage < 80) Then
Grade="N"
ElseIf (percentage >= 80 and percentage < 85) then
Grade="S"
ElseIf (percentage >= 85 and percentage < 90) then
Grade="G"
Elseif (percentage >= 90 and percentage < 95) then
Grade="VG"
Elseif (percentage >= 95 and percentage <= 100) then
Grade="E"
EndIf

TextWindow.WriteLine("Well "+name+ " This is your percent "+percentage+ " and the Letter equivalent is " +Grade)

TextWindow.WriteLine("Do you want to compute for another grade "+name+"?")
TextWindow.WriteLine("Type Y for yes or N for no")
answer = TextWindow.Read()
If Text.ConvertToUpperCase(answer) = "Y" Then
Goto gradestart
Else
Goto End
EndIf


End: