Está en la página 1de 9

program jose_davalillo (input, output);

uses crt;
VAR ano, mes, dia, age , control, categoria : integer;
nombre, apellido : char;
sueldo : integer;
VAR
CI: array [1!"# o$ longint;
%ame: array [1!"# o$ string;
&name: array [1!"# o$ string;
'(: array[1!"# o$ real;
)*+*: array[1!"# o$ integer;
C+(: array[1!"# o$ integer;
VAR %), ,-C : integer; (.contador y decision.)
VAR
i, j,au/0,au/! :integer; (.1uic2sort.)
au/3,au/4:string;
au/1: longint;
CONST
day 5 4";
month 5 1";
year 5 3""6;
7I%ICI, sub_programa calculo de la edad8
FUNCTION Calc_)dad(ano,mes,dia:integer):integer;
9egin
control :5 year:ano ;
if month ; mes then
age :5 control
Else
if month < mes then age :5 control:1
Else
if day <5 dia then age :5 control
else age :5 control:1 ;
Calc_)dad :5 age;
end;
7=I% sub_programa calculo de la edad8
7Comien>o de programa principal8
BEGIN
ClrScr
i :5 " ;
%) :5 " ;
7Inicia -roceso de carga de vectores8
Repeat
%) :5 %) ? 1 ;
ClrScr
!rite(@Ingrese el numero de cedula: @);
rea"ln(CI[%)#);
!riteln
!rite (@Ingrese el nombre del trabajador: @);
rea"ln (%ame[%)#);
!rite (@Ingrese el apellido del trabajador: @);
rea"ln (&name[%)#);
!riteln
!riteln (@Ingrese la $echa de nacimiento:@);
!riteln
!rite (@*ia:@); rea"ln (dia);
!rite (@Aes:@); rea"ln (mes);
!rite (@+no:@); rea"ln (ano);
!riteln
)dad[%)# :5 Calc_edad(ano,mes,dia) ; (.llama $unc calculo de edad.)
!riteln (@Ingrese el sueldo del trabajador:@);
!riteln (@ejemplo: 10"""@);
rea"ln ('([%)#);
if (st[ne#;5 1!"") AN# (st[ne# < 3""") then Cat[%)# :5 1;
if (st[ne#;5 3""") AN# (st[ne# < 3!"") then cat[ne# :5 3;
if (st[ne# ;5 3!"") AN# (st[ne# < 4""") then cat[ne# :5 4;
(.)leccion de continucion de ingreso al usuario.)
!riteln(@::::::::::::::::::::::::::::::::::::::::::::::@);
!riteln(@: -+B+ B)CI'(B+B ,(B, )A-&)+*, -B)'I,%): " :@);
$riteln(@: -+B+ '+&IB D -B)')%(+B &I'(+*, -B)'I,%): 1 :@);
!riteln(@::::::::::::::::::::::::::::::::::::::::::::::@);
!riteln;
!riteln;
$RITE(@Ingrese: @);
rea"ln(,-C);
if ,-C 5 1 then
i :5 i?1;
UNTI% i 5 1;
7(ermina proceso de carga de vectores8
7I%ICI, : 1ICE',B(8
for i :5 1 to %):1 "o
&egin
for j :5 i?1 to %) "o
begin
if CI[i# ; CI[j# then
begin
au/1 :5 CI[i#;
au/3 :5 %ame[i#;
au/4 :5 &name[i#;
au/0 :5 )dad[i#;
au/! :5 Cat[i#;
CI[i# :5 CI[j#;
%ame[i# :5 name[j#;
&name[i# :5 &name[j#;
)dad[i# :5 )dad[j#;
Cat[i# :5 Cat[j#;
CI[j# :5 au/1;
name[j# :5 au/3;
&name[j# :5 au/4;
)dad[j# :5 au/0;
Cat[j# :5 au/!;
end;
end;
end;
7=I%+& : 1FICE',B(8
clrscr
!riteln;
!riteln(@::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::@);
!riteln(@: %, de CI: : %ombre y +pellido : )dad : Categoria :@);
!riteln(@::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::@);
for i :5 1 to %e "o
&egin
!rite(CI[i#:11);
!rite(%+A)[i#:10);
!rite(&name[i#:1");
!rite()dad[i#:G);
!riteln(cat[i#:13);
end;
!riteln(@::::::::::::::::::::::::::::::::::::::::::::::::::::::::::@);
rea"ln
)%*

También podría gustarte