viernes, setiembre 15, 2006

PRACTICA REALIZADA CON 5TO. "C" - REFERENTE A LOS EQUIPOS DE FUTBOL

program foooootballll;
uses crt;
(*AUTOR : DIEGO CUEVA CHAMORRO*)
(*COLEGIO CLARETIANO - TRUJILLO*)
(*QUINTO GRADO DE SECUNDARIA*)
(*FECHA: 13/09/06*)
type
arr=array[1..6,1..3] of integer;
nom=array[1..6] of string;
var
a:arr;
n:nom;
i,j,x,y,gf,gc,d,may,c,pos:integer;

begin
clrscr;
randomize;
n[1]:='Barcelona';
n[2]:='Real Madrid';
n[3]:='Milan';
n[4]:='Chelsea';
n[5]:='Arsenal';
n[6]:='Hamburgo';
for i:=1 to 6 do
begin
writeln;
writeln('======================');
writeln('equipo : ',n[i]);
writeln('resultados de partidos');
writeln('======================');

for j:=1 to 6 do
begin
if j<>i then
begin
writeln;
writeln('contra ',n[j]);
gf:=random(13);
gc:=random(13);
writeln('goles a favor : ',gf);
writeln('goles en contra : ',gc);
a[i,1]:=a[i,1]+gf;
a[i,2]:=a[i,2]+gc;
d:=gf-gc;
a[i,3]:=a[i,3]+d;
end;
readkey;
end;

end;
clrscr;
writeln('resultados');
y:=4;
gotoxy(3,y); write('equipo');
gotoxy(21,y); write('GF');
gotoxy(27,y); write('GC');
gotoxy(33,y); write('DG');
writeln;
writeln('===================================');
y:=y+4;
for i:= 1 to 6 do
begin
gotoxy(3,y); write(n[i]);
gotoxy(20,y); write(a[i,1]:3);
gotoxy(26,y); write(a[i,2]:3);
gotoxy(32,y); write(a[i,3]:3);
y:=y+1;
end;

readkey;

may:=-100;
c:=0;
for i:=1 to 6 do
begin
if a[i,3]>may then
begin
may:=a[i,3];
c:=1;
pos:=i;
end
else
begin
if a[i,3]=may then
c:=c+1;
end;
end;

writeln;
writeln;

if c=1 then
writeln('- El ganador es el ',n[pos],', con diferencia de goles ',may)
else
writeln('- Hay un empate entre ',c,' equipos, con diferencia de goles de ',may);
readkey;
end.

martes, setiembre 12, 2006

EJERCICIO 4TO. SECUNDARIA -CLARETIANO

program eje;
(*AUTOR: RENZO CACERES SEMINARIO
GRADO: 4TO. SECUNDARIA – COLEGIO CLARETIANO – TRUJILLO
FECHA: 12/09/2006*)
uses crt;
const nulo='';
type trabajador=record
nom,a,cod:string[30];
he:integer;
sb,sbr,phe,afp,mv,dscto,sn:real;
end;
reg1 = array [1..1000] of trabajador;
var tra:trabajador;
empleado:reg1;
sw,c,i:integer;
begin
clrscr;
writeln('AUTOR: RENZO CACERES SEMINARIO');writeln;
repeat
write('Codigo: ');readln(tra.cod);
if tra.cod<>nulo then
begin
with tra do
begin
write('Nombre: ');readln(nom);
write('Area: ');readln(a);
write('Sueldo Basico: ');readln(sb);
write('Horas Extras: ');readln(he);
c:=c+1;
empleado[c]:=tra;
clrscr;
end;
end;
until (tra.cod=nulo) or (c>=1000);
for i:=1 to c do
begin
with empleado[i] do
begin
phe:=(he*sb)/240;
sbr:=sb+phe;
afp:=0.13*sb;
mv:=0.13*sb;
dscto:=afp+mv;
sn:=sbr-dscto;
end;
end;
clrscr;
for i:=1 to c do
begin
with empleado[i] do
begin
gotoxy(2,2);write('Empleado: ',nom);
gotoxy(2,4);write('Area: ',a);
gotoxy(2,6);write('Ingresos ');
gotoxy(29,6);write('Deducciones ');
gotoxy(60,6);write('Neto ');
gotoxy(2,8);write('Sueldo Basico: ',sb:4:2);
gotoxy(30,8);write('AFP: ',afp:15:2);;
gotoxy(2,10);write('Horas Extras: ',phe:7:2);
gotoxy(30,10);write('Mi Vivienda: ',mv:7:2);
gotoxy(15,12);write(sbr:8:2);
gotoxy(45,12);write(dscto:4:2);
gotoxy(60,12);write(sn:4:2);
end;
end;
readkey;
end.

lunes, setiembre 11, 2006

PROGRAMA REINAS DE BELEZA - PARA 5TO. "C"- CLARETIANO

Program Reinas;
Uses Crt;
(*Autor: Héctor Luyo CH.*)
(*Grado: Quinto de Secundaria "C"*)
(*Fecha: 11/09/06*)
Type
matriz=Array[1..12,1..4] of Integer;
Vector=Array[1..12] of Integer;
Var m1:matriz;
v1:vector;
i,j,x,y,pos,sw,may,c:Integer;
Begin
clrscr;
Randomize;
For i:=1 to 12 Do
Begin
For j:=1 to 4 Do
Begin
m1[i,j]:=random(11);
v1[i]:=v1[i]+m1[i,j];
End;
End;
gotoxy(4,2);Writeln('Nro.');
gotoxy(11,2);write('B.');
gotoxy(16,2);write('I.');
gotoxy(21,2);write('C.');
gotoxy(26,2);write('D.');
gotoxy(33,2);write('Ptos.');
For i:=1 to 12 do
begin
gotoxy(5,i+3);write(i);
end;
y:=4;
For i:=1 to 12 Do
Begin
x:=10;
For j:=1 to 4 Do
Begin
gotoxy(x,y); write(m1[i,j]:2,' ',v1[i]:4);
Inc(x,5);
End;
Inc(y); may:=0;
End;
For I:=1 to 12 do
Begin
If v1[i]> may then
Begin
may:=v1[i];
pos:=i
end;
end;
v1[pos]:=0;
SW:=0; c:=1;
for i:=1 to 12 do
Begin
If may=v1[i] then
Begin
sw:=1;
c:=c+1;
End;
End;
Writeln;writeln;
If SW=0 then
Writeln('La Ganadora es la candidata Nro. : ',pos,' con ',may, ' puntos')
Else
writeln('No hay ganadora, exite empate entre ',c,' candidata(s)',' con ', may,' puntos');
Readkey
End.

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.