Hi, im new to this forum, and searched for everything to do with 2D array, but found nothing to no real avail.
My problem is that i have to write a 2D array in pascal that stores 15 student ID's and 5 marks for each student. I've managed to write out about 60% of it, but it fails to work as i think i've instructed it.
Heres the code:
program array2d;
uses crt;
var
Marks : array[1..5,1..15] of integer;
Student_Id : integer;
Student_Mark : integer;
Procedure Input;
begin
for Student_Id := 1 to 15 do
begin
for Student_Mark := 1 to 5 do
begin
write('Enter Student Mark ');
readln(Marks[Student_Id,Student_Mark]);
end;
end;
end;
Procedure Output;
begin
for Student_Id := 1 to 15 do
begin
for Student_Mark := 1 to 5 do
begin
write(Marks[Student_Id,Student_Mark],' ');
end;
writeln;
end;
end;
begin
clrscr;
Input;
Writeln;
Output;
writeln;
readln;
end.
Problem being is that it asks for 75 marks for each student but not in any particular order, it doesn't actually ask for the student ID's. I know this is missing from the code, but I'm stuck as to what to enter. It all has to be in "Incredibly Basic" tags as I'm a first year student. This confuses me so much, Please Help!!! it would be greatfuly appreciated!
p.s. sorry for asking a silly question :P