Is there anyway to make a case statement of an array? I am doing my CPSC assignment and having trouble with this mother.. I'm no coder hahaha

Well the program is supposed to prompt you to enter letter grades of a class of 25 students, it will convert ABCDF grades into GPA scores, and W will be a null value.... if the user decides to quit he/she can enter in 'Q' or 'q', and the loop will stop...

I have most of the program typed out, compiles and displays, but I'm moving on the next step.

So far my program will display ANY letter grade, so I decided to use a Case Statement.

I made the array type so I can pass into parameters of procedures:

type
gradeList = array(1..classMax)of char;
**classMax is 5 students for now for testing**

and the array itself..
classGrades : gradeList

The input procedure is

procedure enterGrades (var classGrades : gradeList;
* * * * * * * * * * * var size* : integer);
begin
* var i* * * * * : integer;

* for i:=1 to classMax do
* begin
* * * writeln('Student #',(size+1),' Max students= ',classMax);
* * * write('Enter the letter grade for student #',i,': '
* * * readln(classGrades[i]);

* * gradeInput(classGrades,size);
Now my problem is gradeInput procedure. It is the procedure of which it is checking if the values entered are valid. Also I need to find a way to get out of the loop without compromising the student counter in the FOR loop (size+1.

I tried doing this:

procedure gradeInput(var classGrades : gradeList;
* * * * * * * * * * * * * * * * * * var size* * * * * * :* integer);
begin
* var i : integer;* <-- in case I need it
* case(classGrades)* <--- I tried both classGrades and classGrades[i]
* * &#39;A&#39;,&#39;a&#39;, etc. until &#39;F&#39;,&#39;f&#39;:* * <-- I didn&#39;t actually type etc and all that jazz
* * * size=size+1 (it is valid so the student counter goes up

etc.
It won&#39;t compile&#33; probably because I don&#39;t know how to use case statements to read arrays

Any help from coders is appreciated haha. Long read indeed.