You are on page 1of 9

ogram project1;

uses
crt;
type
Tpers = record
nombre : string[30];
documento: integer;
salario:real;
end;
Tpersonas = array[1..50] of TPers;
var
listaPers: TPersonas;
i,n,f,n2,docu : integer;
op: integer;
mayor:real;
r,res:string[1];

encontrado,borrar :boolean ;
begin
repeat
begin
writeln('1=ingresar datos');
writeln('2=mostrar datos');
writeln('3=buscar un empleado');
writeln('4= eliminar');
writeln('5=mostrar empleado con mayor sueldo');

writeln('6=mostrar monto');
writeln('ingrese una opcion');
readln(op);

end;
case op of
1:
begin
clrscr;
n:=0 ;
repeat
n:=n+1 ;

with listaPers[n] do
begin
write('Ingrese nombre, documento, salario: ');
readln(nombre, documento, salario);

writeln('desea continuar');
readln(r);
end;

until r='n'

end;

2:
begin
clrscr;
for i := 1 to n do

with listaPers[i] do
begin
writeln('nombre: ', nombre);
writeln('documento: ', documento);
writeln('salario: ', salario);
end;

readkey;
end;

3:
begin
clrscr;
writeln('ingrese documento a buscar');
readln( docu );
encontrado:=false;
for i:=1 to n do

if (docu =listaPers[i].documento) then


begin
encontrado:=true;

writeln (i, ': nombre' , listaPers[i].nombre ,'documento',listaPers[i].documento ,


'salario', listaPers[i].salario);
end;
if encontrado=false then
writeln('nose encontro')
//end;
end;
4:
begin
clrscr;
writeln('ingrese documento a buscar');
readln( docu );
borrar:=false;
for i:=1 to n do

if (docu =listaPers[i].documento) then


begin
writeln('desea borrar este archivo');
readln(res);
if res='s' then
begin
listaPers[i]:=listaPers[i+1];
n:=n-1;
end;
readkey;
end;

end;

5:
begin
clrscr;
mayor:=listaPers[1].salario ;
for i:=2 to n do
with listaPers[i] do
if listaPers[i].salario<mayor then
begin
mayor:=listaPers[i].salario;
end;
writeln(listaPers[i].nombre,listaPers[i].documento,listaPers[i].salario);
end;
end;

until op=6;
end.

program project1;
uses
crt;

type
Tpers = record
cedula: integer;
nombre : string[30];
prestamo: real;
interes :real;
fecha:Tfecha;
end;
Tfecha=record
dia:integer;
mes:integer;
anio:integer;
end;

Tpersonas = array[1..50] of TPers;


var
lista: TPersonas;
i,n,f,n2,docu,doc : integer;
op: integer;
mayor:real;
r,res:string[1];
nom:string[30];
encontrado,borrar :boolean ;
begin
clrscr;
repeat

begin
writeln('1=ingresar cliente');
writeln('2=mostrar datos');
writeln('3=sueldo a pagar');
readln(op);

end;
case op of
1:
begin
clrscr;
n:=0 ;
repeat
n:=n+1 ;

with lista[n] do
begin
write('Ingrese cedula, nombre,valor del prestamo,interes,fecha del prestamo : ');
readln(cedula,nombre,prestamo,interes,fecha);

writeln('desea continuar');
readln(r);
end;

until r='n'

end;

2:
begin
clrscr;
for i := 1 to n do

with lista[i] do
begin
writeln('cedula: ', cedula);
writeln('nombre: ', nombre);
writeln('prestamo: ', prestamo);
writeln('interes: ',interes);
writeln('fecha del prestamo: ',fecha);
end;

readkey;
end;

3:
begin
clrscr;
for i:=1 to n do
c:=((lista[i].prestamo* lista[i].interes)/100)*360
end;

until op=6;
end.

You might also like