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.
Help! I need some help with my programming!
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:
IDArray: Array[1..8] of string;
ScoreArray: Array[1..8] of integer;
GradeArray: Array[1..8] of char;
procedure InputSub(var X: integer; ScoreArray, Score: integer;
IDArray, ID: string);
X := 1;
While not EOF(Data) Do
readln(Data, IDArray[X], ScoreArray)
function ExamGrade(Score: integer):char;
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';
procedure PrintSub(var X: integer; GradeArray: char;
ScoreArray:integer; IDArray: string);
Writeln(IDArray:10, ScoreArray:10, GradeArray:10);
InputSub(var X: integer; ScoreArray, Score: integer; IDArray, ID:
For X := 1 to 8 Do
GradeArray[X] := ExamGrade(ScoreArray);
PrintSub(var X: integer; GradeArray: char; ScoreArray:integer;
The problem happens on the main program, when it reaches the start of the InputSub. Could someone help me, please? It would be much appreciated!
0 · ·