program sched3; uses crt; { This program will use an array to record what class the user has for each of 7 periods, then it will print out the name of the course that the user wishes to view. by } type schedule = array[1..7] of string[15]; var frosh,soph,jun,sen : schedule; x,y:integer; procedure input; begin for y := 1 to 4 do begin case y of 1:writeln ('Freshman :'); 2:writeln('Sophmore :'); 3:writeln('Junior :'); 4:writeln('Senior :'); end; writeln ('Enter what class you have for period -'); for x := 1 to 7 do begin write (x,' : '); case y of 1:readln (frosh[x]); 2:readln (soph[x]); 3:readln (jun[x]); 4:readln (sen[x]); end; end; clrscr; end; end; begin clrscr; input; delay (500); clrscr; repeat writeln ('What year do you want to look at?'); writeln ('(1 for Freshman, 2 for Sophmore, ect - Press ''0'' to quit or ''5'' for all)'); readln (y); if (y >= 1) and (y <= 4) then begin writeln ('What period do you want to look at?'); readln (x); if (x >= 1) and (x <= 7) then begin writeln; writeln; case y of 1: writeln ('During period ',x,', you have ',frosh[x]); 2: writeln ('During period ',x,', you have ',soph[x]); 3: writeln ('During period ',x,', you have ',jun[x]); 4: writeln ('During period ',x,', you have ',sen[x]); end; readkey; end; end; if y = 5 then begin for y := 1 to 4 do begin writeln; for x := 1 to 7 do begin case y of 1: writeln ('Year ',y,', period ',x,' : ',frosh[x]); 2: writeln ('Year ',y,', period ',x,' : ',soph[x]); 3: writeln ('Year ',y,', period ',x,' : ',jun[x]); 4: writeln ('Year ',y,', period ',x,' : ',sen[x]); end; end; if wherey > 19 then begin writeln; write ('--More--'); readkey; clrscr; end; end; readkey; end; clrscr; until y = 0; end.