Module Module1
Sub Main()
Dim i As Integer
Dim score As Integer
Dim NumF, NumD, NumDD, NumA As Integer
Dim max, min, sum As Integer
max = 0
min = 100
For i = 1 To 10 Step 1
'รับค่า
Console.Write("Enter int score no :" & i & " ")
score = Console.ReadLine
While score < 0 Or score > 100
Console.WriteLine("Invalid")
Console.Write("Enter int score no :" & i & " ")
score = Console.ReadLine
End While
sum = sum + score
Select Case score
Case 0 To 50
Console.WriteLine("F")
NumF += 1 'นับสะสมทีละ1
'NumF = NumF + 1'
Case 51 To 60
Console.WriteLine("D")
NumD += 1
Case 61 To 70
Console.WriteLine("D+")
NumDD += 1
Case 71 To 100
Console.WriteLine("A")
NumA += 1
End Select
Next
Console.WriteLine("Number of grade A = " & NumA)
Console.WriteLine("Number of grade D+ = " & NumDD)
Console.WriteLine("Number of grade D = " & NumD)
Console.WriteLine("Number of grade F = " & NumF)
End Sub
End Module