martes, setiembre 05, 2006

PROGRAMA PARA 4TO DE SECUNDARIA

(*PROGRAMA TRABAJADO EN EL LABORATORIO EL DIA: 06-09-06*)


Program Regalumnos;
Uses Crt;
(* Autor: H‚ctor Luyo Ch.*)
(*Profesor: Colegio Claretiano - Trujillo*)
(*Grado: 4to. Secundaria*)
(*Fecha: 05/09/06*)
Type
Alumnos=Record
cod:String[4];
Nom:String[30];
sex:Char;
pp,ep,ef:Integer;
prom:Real;
End;
Arreglo=Array[1..40] of Alumnos;
Var Dalum:Arreglo;
n,i,ha,hd,ma,md,ta,td:Integer;
Begin
Clrscr;
Repeat
Clrscr;
Write('Ingrese Nro. de alumnos a procesar <= 40 : ');
Readln(n);
Until n<= 40 ;
Clrscr;
For i:= 1 to n do
Begin
With Dalum[i] do
Begin
Clrscr;
Write('Codigo : ');Readln(Cod);
Write('Nombre : ');Readln(Nom);
Write('Sexo : ');
Repeat
sex:=Upcase(Readkey);
Until sex In['H','M'];
writeln(sex);
Write('Promedio de Pr cticas : ');Readln(pp);
Write('Ex men Parcial : ');Readln(ep);
Write('Ex men Final : ');Readln(ef);
End;
End;
For i:= 1 to n do
Begin
With Dalum[i] do
Begin
prom:=(pp*2+ep*2+ef*3)/7;
End;
End;
For i:= 1 to n do
Begin
With Dalum[i] do
Begin
If prom>=11 Then
Begin
Case Sex Of
'H':ha:=ha+1;
'M':ma:=ma+1;
End;
End
Else
Begin
Case Sex Of
'H':ha:=ha+1;
'M':ma:=ma+1;
End;
End;
End;End;
Clrscr;
Writeln('REPORTE DE ALUMNOS APROBADOS ');
For i:= 1 to n do
Begin
With Dalum[i] do
Begin
If prom>=11 Then
Begin
Writeln('Codigo : ',Cod);
Writeln('Nombre : ',Nom);
Writeln('Sexo : ',sex);
Writeln('Promedio : ',prom:4:2);
Writeln('Presione una Tecla......>');Readkey;
End;
End;
End;
Clrscr;
Writeln('REPORTE DE ALUMNOS DESAPROBADOS ');
For i:= 1 to n do
Begin
With Dalum[i] do
Begin
If prom<11 Then
Begin
Writeln('Codigo : ',Cod);
Writeln('Nombre : ',Nom);
Writeln('Sexo : ',sex);
Writeln('Promedio : ',prom:4:2);
Writeln('Presione una Tecla......>');Readkey;
End;
End;
End;
Writeln;
Writeln('Total de Hombres Aprobados : ',ha);
Writeln('Total de Mujeres Aprobadas : ',ma);
Writeln('Total de Alumnos Aprobados : ',ta);
Writeln('Total de Hombres Desaprobados : ',hd);
Writeln('Total de Mujeres Desaprobadas : ',md);
Writeln('Total de Alumnos Desaprobados : ',td);
Readkey;
End.