Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I am working on an assignment for my programming class and I keep coming up with this problem. ERROR 20: Variable Identifier expected.
Here is my code:
Program FinalProgram; Uses Crt; var IDArray: Array[1..8] of string; ScoreArray: Array[1..8] of integer; GradeArray: Array[1..8] of char; Data: text; Score: integer; ID: string;
procedure InputSub(var X: integer; ScoreArray, Score: integer; IDArray, ID: string); begin clrscr; Assign (Data,'C:scores.txt'); Reset (Data); X := 1; While not EOF(Data) Do begin readln(Data, IDArray[X], ScoreArray) end; Close (Data); end;
function ExamGrade(Score: integer):char; begin If Score >= 90 Then ExamGrade := 'A'; If Score >=80 Then ExamGrade := 'B'; If Score >= 70 Then ExamGrade := 'C'; If Score >= 60 Then ExamGrade := 'D'; If Score <= 59 Then ExamGrade := 'F'; end;