Question
If StudentData.txt file looks like this: 101,70 132,75 153,80 If a sub called student looks like this: Sub Student() Dim StudentID As Integer Dim Score
If StudentData.txt file looks like this: 101,70 132,75 153,80 If a sub called student looks like this: Sub Student() Dim StudentID As Integer Dim Score As Integer Dim TotalScore As Integer Dim Counter As Integer FileOpen(1, StudentData.txt, OpenMode.Input) Do Until EOF(1) Input(1, StudentID) Input(1, Score) TotalScore = TotalScore + Score Counter = Counter + 1 Loop FileClose(1) Dim TheGrade As String = "" Call ComputeGrade(Score, TheGrade) MsgBox(Grade for & StudentID & = & TheGrade) End Sub Sub ComputeGrade(ByVal Score As Integer, ByRef Grade As String) If Score >= 90 Then Grade = A If Score >= 80 And Score < 90 Then Grade = B If Score >= 70 And Score < 80 Then Grade = C If Score >= 60 And Score < 70 Then Grade = D If Score < 60 Then Grade = F End Sub
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started