Documentos de Académico
Documentos de Profesional
Documentos de Cultura
CARRERA INGENIERA
TAREA
TRABAJO PRCTICO: X
ASIGNATURA: COMPUTACIN I
CDIGO: 323
CENTRO LOCAL:GUARICO
CARRERA: 236/280
NMERO DE ORIGINALES: 01
RESULTADOS DE CORRECCIN:
OBJ. N 5 6 7
0:NL 1:L
Algoritmo TOURSVEN;
Inicio
Definir Registro
Apellidos : carcter;
nombres : carcter;
pasaporte : numrico;
edad : carcter;
sexo : carcter;
fecha_exp : numrico;
origen :carcter;
fecha_vac : numrico;
fecha_declara : numrico;
fin_registro;
variables
n : entero;
otro :carcter;
tipo
datos :registro;
Procedimiento ModificarDatos;
Var
busca_pasaporte : numrico;
i : numrico;
Inicio
Escribir Modificacion de Datos de Viajeros;
Escribir Introduzca el nmero de Pasaporte a Modificar;
Leer busca_pasaporte;
i=0;
Hacer
Si busca_pasaporte = datos[i].pasaporte entonces
Escribir Introduzca Nombres y Apellidos;
Leer datos[i].apellidos_nombres;
Escribir Numero de pasaporte;
Leer datos[i].pasaporte;
Escribir Fecha de Expiracion;
Leer datos[i].fechapas;
Escribir Pais de Origen;
Leer origen[i];
Escribir Fecha de Vacunacion;
Leer fechavac[i];
Escribir Fecha de Declaracion de Impuestos;
Leer fechadec[i];
Sino entonces i=i+1;
FinSi;
Hasta i=n; {repite hasta el tamao de los datos}
Fin {Fin de Buscar para Modificar}
Procedimiento EliminarDatos;
Var
busca_pasaporte : numrico;
i : numrico;
resp :carcter;
Inicio
Escribir Eliminar de Datos de Viajeros;
Escribir Introduzca el nmero de Pasaporte a Eliminar;
Leer busca_pasaporte;
i=0;
Hacer
Si busca_pasaporte = pasaporte[i] entonces
Escribir Introduzca Nombres y Apellidos;
Leer apellidos_nombres[i];
Escribir Numero de pasaporte;
Leer pasaporte[i];
Escribir Fecha de Expiracion;
Leer fechapas[i];
Escribir Pais de Origen;
Leer origen[i];
Escribir Fecha de Vacunacion;
Leer fechavac[i];
Escribir Fecha de Declaracion de Impuestos;
Leer fechadec [i];
Escribir Desea Eliminar (S/N)
Leer resp;
Si resp=S
Eliminar Registro;
Finsi;
Inicio
i=0;
j=1;
Con datos[i].pasaporte
Si datos[i].pasaporte > datos[j].pasaporte
temp=datos[i];
datos[i]=datos[j];
datos[j]=temp;
finsi
con datos[i] hacer
Escribir Pasaporte :, datos[i].pasaporte;
Fin hacer
Fin
Procedimiento vigentes
Var
Fechaact: cadena;
i: entero;
Inicio
Con datos[i].fechapas
Si datos[i].fechapas > fechaact;
Datos[i].activo=VERDADERO;
Sino
Datos.activo=FALSO;
Finsi
Repetir mientras datos[i].activo=VERDADERO
Escribir datos[i].pasaporte;
Fin
Fin
Procedimiento novigentes
Var
Fechaact: cadena;
i: entero;
Inicio
Con datos[i].fechapas
Si datos[i].fechapas > fechaact;
Datos[i].activo=VERDADERO;
Sino
Datos.activo=FALSO;
Finsi
Repetir mientras datos[i].activo=FALSO
Escribir datos[i].pasaporte;
Fin
Fin
Procedimiento nacionalidad
Var
Fechaact: cadena;
i: entero;
Inicio
Con datos[i].origen
Si datos[i].origen = V;
Escribir Pasportes Venezolanos;
Escribir datos[i].pasaporte;
Sino
Escribir Pasportes Extranjeros;
Escribir datos[i].pasaporte;
Finsi
Fin
Procedimiento Menu;
Var
Opcin: carcter;
Inicio
Mientras opcin <> S
Escribir Tuorsven CA Menu de Opciones;
Escribir (' I = Incluir Viajeros');
Escribir (' C = Consultar Viajeros');
Escribir (' M = Modificar Viajeros');
Escribir (' E = Eliminar Viajeros');
Escribir (' R = Reporte Personalizado');
Escribir (' S = Salir');
Leer opcin
Si opcin = I entonces incluirviajeros;
Si opcin = C entonces consultarviajeros;
Si opcin = M entonces modificarviajeros;
Si opcin = E entonces eliminarviajeros;
Si opcin =R entonces reportes;
FIN
FIN
Programa toursven
Inicio
Men;
Fin
Programa en Pascal
program toursven;
uses
crt, dos;
const
archi = 'toursven.dat';
type
string12 = string[12];
viajero = record
activo : boolean;
pasaporte : longint;
nombre : string[80];
apells : string[80];
edad : integer;
sexo : char;
fechapas : string[12];
origen : char;
fechavac : string[12];
fechadec : string[12];
fechalt : string[12];
fechent : string[12];
end;
var
f : file of viajero;
datos : viajero;
ano, mes, dia, sem : word;
procedure entradaviajero;
var
tec : char;
begin
clrscr;
writeln('***** Ingreso Viajero *****');
writeln;
with datos do
begin
activo := true;
write(' Num. Pasaporte. : ');
readln(pasaporte);
write(' Nombre : ');
readln(nombre);
write(' Apellidos : ');
readln(apells);
write(' Edad : ');
readln(edad);
write(' Sexo [F/M] : ');
readln(sexo);
write(' Fecha de Expiracion Pasaporte: (dd/mm/yyyy)');
readln(fechapas);
write(' Origen (V) Venezolano (E) Extranjero: ');
readln(origen);
write(' Fecha de Tarjeta Vacunacion: (dd/mm/yyyy)');
readln(fechavac);
write(' Fecha Declaracion Impositiva: (dd/mm/yyyy)');
readln(fechadec);
fechent := diaactual;
writeln;
writeln(' >>> Datos Correctos [S/N] <<<');
repeat
tec := upcase(readkey);
until tec in['S','N'];
if tec = 'S' then
begin
if guardardatos(datos) = true then
writeln(' Datos De Pasajero Guardados ')
else
for hh := 0 to filesize(f) - 1 do
begin
seek(f,hh);
read(f,datos);
if datos.pasaporte <> num then
begin
end
else
begin
datos.activo := false;
seek(f,hh);
write(f,datos);
end;
end;
close(f);
end;
end;
procedure ordena;
begin
for i := 1 to 8 do
for j := 8 downto t + 1 do
if datos[i].pasaprte < equipos[j].puntos then
begin
aux := datos[j];
datos[j] := datos[i];
datos[j] := aux;
end;
end;
pul : char;
pos, tt : longint;
sil : boolean;
d, m, an : word;
d1, m1, an1 : word;
d3, m3 : word;
dar : string[2];
ay : string[4];
totaldias, error : integer;
begin
assign(f,archi);
{$I-} reset(f); {$I+}
if ioresult <> 0 then
begin
writeln(' Error Archivo No Encontrado Pulse Una Tecla');
readkey;
end
else
begin
sil := false;
for tt := 0 to filesize(f) - 1 do
begin
seek(f,tt);
read(f,datos);
if datos.pasaporte = num then
begin
sil := true;
pos := tt;
break;
end;
end;
if sil = true then
begin
if datos.activo = true then
begin
writeln(' Desea Revisar la Documentacion [S/N]');
repeat
pul := upcase(readkey);
until pul in['S','N'];
if pul = 'N' then
datos.fechalt := diaactual;
if pul = 'S' then
begin
writeln(' Entre Fecha Actual ');
writeln;
write(' Fecha : ');
readln(datos.fechalt);
if datos.fechalt[2] = '/' then
insert('0',datos.fechalt,1);
if datos.fechalt[5] = '/' then
insert('0',datos.fechalt,4);
end;
dar := copy(datos.fechent,1,2);
val(dar,d,error);
dar := copy(datos.fechent,4,2);
val(dar,m,error);
ay := copy(datos.fechent,7,4);
val(ay,an,error);
dar := copy(datos.fechalt,1,2);
val(dar,d1,error);
dar := copy(datos.fechalt,4,2);
val(dar,m1,error);
ay := copy(datos.fechalt,7,4);
val(ay,an1,error);
d3 := 0;
m3 := 0;
d3 := d1 - d;
m3 := m1 - m;
writeln;
writeln(' <<< Pulse Una Tecla >>>');
readkey;
seek(f,pos);
write(f,datos);
close(f);
end
else
begin
writeln(' El Pasaporte No Esta Activo ');
writeln(' <<< Pulse Una Tecla >>>');
readkey;
close(f);
end;
end;
end;
end;
procedure menu;
var
tecla : char;
sal : boolean;
nnm : longint;
begin
sal := false;
repeat
clrscr;
writeln(' ***** Menu ToursVEN*****');
writeln;
writeln(' I = Incluir Viajeros');
writeln(' C = Consultar Viajeros');
writeln(' M = Modificar Viajeros');
writeln(' E = Eliminar Viajeros');
writeln(' R = Reporte Personalizado');
writeln(' S = Salir');
writeln;
writeln(' <<< Elija Opcion >>>');
repeat
tecla := upcase(readkey);
until tecla in['I','C','M','E','R','S'];
clrscr;
case tecla of
'I' : entradaviajero;
'C' : begin
write(' Pasaporte a Consultar : ');
readln(nnm);
consultar(nnm);
end;
'M' : begin
write(' Pasaporte a Modificar: ');
readln(nnm);
modificadatos(nnm);
end;
'E' : begin
write(' Pasaporte a Eliminar : ');
readln(nnm);
eliminaviajero(nnm);
end;
'R' : begin
write(' Nro de Reporte que desea : ');
readln(nnm);
reporte(nnm);
end;
'S' : sal := true;
end;
until sal = true;
end;
begin
clrscr;
menu;
end.