Está en la página 1de 5

program project1;

uses
crt;
type
Tfecha = record
dia : integer;
mes: integer;
anio: integer;
end;

Tpers=record
nombre: string[30];
dni: integer;
end ;
Thabitaciones=record
nro: integer;
libre: string [10];
ingreso: Tfecha;
salida: Tfecha;
huesped: Tpers;
end;

listhabitacion=array [1..10,1..10] of Thabitaciones ;


var
hotel: listhabitacion;
x,y ,op,piso,num,doc,pos,f,p: integer

op2:char;
begin
repeat
begin
writeln('1=cargar huesped ');
writeln('2=mostrar datos segun la habitacion');
writeln('3=buscar huested x su dni');

readln(op);

end;
begin
clrscr;
case op of
1:
begin
with hotel[x,y] , ingreso, huesped do
repeat
x:=0;
y:=0;
begin
writeln('ingrese piso') ;
readln(piso);
writeln('ingese nro de habitacion');
writeln('1 al 5 habitaciones simples cada noche $150');
writeln('6 al 10 habitaciones para dos o mas personas cada noche $250');

readln(num);
if ('ocupado'= hotel[piso,num].libre) then
begin
writeln('ocupado');
readkey;
end
else
begin
writeln('ingrese datos de huesped'); readln (nombre,dni );
writeln('fecha de ingreso'); readln (dia,mes,anio);
writeln('fecha de salida'); readln (dia,mes,anio );
hotel[piso,num].libre:='ocupado';

writeln('desea continuar');
readln(op2);
readkey;
end ;
x:=x+1;
y:=y+1;

end;

until op2='n' ;
end;

2:

begin
writeln('ingrese piso');
readln(piso) ;
writeln('ingrese habitacion');
readln(num) ;
with hotel[x,y] , ingreso, huesped do
if ('ocupado'= hotel[piso,num].libre) then
begin

writeln(' datos de huesped',hotel[x,y].huesped.nombre,hotel[x,y].huesped.dni);


writeln('fecha de ingreso', dia,'/',mes,'/',anio);
writeln('fecha de salida', dia,'/',mes,'/',anio);
writeln( hotel[piso,num].libre) ;
readkey;
end
else

writeln('esta habitacion esta libre');


end;

3:
begin

writeln ('ingrese numero de documento');


readln (doc) ;
for x:=1 to 10 do

for y:=1 to 10 do
with hotel[x,y] do
if doc= hotel[x,y].huesped.dni then
begin
pos:=hotel[x,y]i;
f:=x;
p:=y;
writeln('el huesped se encuentra en el piso',f,'habitacion',p);
end
else
writeln('no se encontro al huesped');
readkey;
end ;
end;
end;
until op=6
end.

También podría gustarte