Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program OtroProgra (input, output);
- type regis = record lega: string [8];
- brenom_ape: string [25];
- nota1, nota2: real;
- end;
- var
- index: integer;
- Alumno: array[1..50] of regis;
- Archi: file of regis;
- Promes: array[1..50] of real;
- alguPromo: boolean;
- cantiRecu, PromosIndex, LibresIndex: integer;
- Libres, Promos: array[1..50] of regis;
- BEGIN
- assign(Archi, 'C:/Win8/curso_mat.dat');
- reset(Archi);
- index:= 0;
- cantiRecu := 0;
- LibresIndex := 0;
- PromosIndex := 0;
- While not EOF(Archi) do begin
- index:= index + 1;
- Read(Archi, Alumno[index]);
- Promes[index] := (Alumno[index].nota1 + Alumno[index].nota2) / 2;
- if Promes[index] >= 6 then begin
- alguPromo := true;
- PromosIndex := PromosIndex + 1;
- Promos[PromosIndex]:= Alumno[index];
- end;
- else begin
- if Promes[index] > 4 then cantiRecu:= cantiRecu + 1;
- else begin
- LibresIndex := LibresIndex 1;
- Libres[LibresIndex] := Alumno[index];
- end;
- end;
- end;
- if alguPromo then begin
- writeln('Legajo Apellido y Nombre Promedio');
- writeln('-------- ------------------------- --------');
- for i:=1 to PromosIndex do writeln(Promos[i].lega,' ',Promos[i].brenom_ape,' ',((Promos[i].nota1 + Promos[i].nota2) / 2):4:2);
- end;
- else writeln('No hay promovidos.');
- writeln('Alumnos que tienen que hacer el examen de recuperacion: ',cantiRecu);
- if LibresIndex > 0 then begin
- writeln('Legajo Apellido y Nombre Nota1 Nota2');
- writeln('-------- ------------------------- ----- -----');
- for i:=1 to PromosIndex do writeln(Promos[i].lega,' ',Promos[i].brenom_ape,' ',Promos[i].nota1:4:2,' ', Promos[i].nota2:4:2);
- end;
- END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement