You are on page 1of 49

{Programa desenvolvido por GUILHERME AUGUSTO RODRIGUES aluno do 1º periodo de

Analise de Sistemas da Faculdade De Computacao de Montes Claros ____FACOMP____.


}
program GERENCIA_HOTEL;
uses
DoS, Crt;
type
cadastro = record
Nome: string[35];
Rua: string[30];
Numero: word;
Bairro: string[30];
RG, Telefone, Cep: longint;
OBS : string;
end;
arquivo = file of cadastro;
var
pagina: cadastro;
pagina1, pagina2, pagina3 : cadastro;
cadhotel: arquivo;
I :integer;
L : byte;
{==========================cria os arquivos dos sub-programas==================}
procedure criaarquivo;
var
blocka : text;
block : text;
ARQTXT : text;
hospede : text;
cadcpf : text;
begin
assign(blocka, 'blocka.dat');
{$I-}
reset(blocka);
{$I+}
if(IOResult <> 0) then
rewrite(blocka);
close(blocka);
assign(block, 'block.dat');
{$I-}
reset(block);
{$I+}
if(IOResult <> 0) then
rewrite(block);
close(block);
assign(ARQTXT, 'ARQTXT.dat');
{$I-}
reset(ARQTXT);
{$I+}
if(IOResult <> 0) then
rewrite(ARQTXT);
close(ARQTXT);
assign(hospede, 'hospede.dat');
{$I-}
reset(hospede);
{$I+}
if(IOResult <> 0) then
rewrite(hospede);
close(hospede);
assign(cadcpf, 'cadcpf.dat');
{$I-}
reset(cadcpf);
{$I+}
if(IOResult <> 0) then
rewrite(cadcpf);
close(cadcpf);
I := 1;
repeat
textcolor(12);
gotoxy(45,25);write('CRIANDO ARQUIVOS .');
delay(200);
gotoxy(45,25);write('CRIANDO ARQUIVOS .');
delay(200);
gotoxy(45,25);write('CRIANDO ARQUIV0S .');
gotoxy(45,25);write('CRIANDO ARQUIVOS ');
delay(200);
if I = 6 then begin
gotoxy(45,25);write(' OK ');delay(200);
end;
I := I + 1;
until I = 7;
end;
{==========================cria os arquivos dos sub-programas=============FIM==}
{=========================sub-programa reserva de apartamentos=================}
procedure reserva;
var
hospede : text;
Nomea: string[35];
LAPTO, HOSP: string[13];
NAS1, NAS2, NAS3 : integer;
APTO:byte;
CPF :longint;
DIGT:byte;
RG:longint;
DDD:byte;
FONE :longint;
FONEA :longint;
PER, QAPTO:byte;
HOS, ANI: char;
QUAN: byte;
GAR : string[3];
DD, M, AA: integer;
HORA : string[10];
ESTAC : string;
TECLA : char;
OPCAO : char;
procedure CENTER(MENSAGEM : string); {moldura CENTER para o menu principal}
var
TAMANHO : integer;
begin
TAMANHO := 40 + length(MENSAGEM) div 2;
writeln(MENSAGEM:TAMANHO);
end;
procedure WRITEXY(X, Y : byte; MENSAGEM : string);
begin
gotoxy(X, Y); write(MENSAGEM);
end;
procedure LINE; {moldura LINE para o menu principal}
var
I : byte;
begin
for I := 1 to 80 do
write(#205);
gotoxy(1,23);
for I := 1 to 80 do
write(#205);
gotoxy(1,24);
write('=\_______________________________________________________________________
_____/=');
end;
procedure CADASTRA;
var
tot, pe, level : real;
hh,mm,ss,cs:word;
begin
clrscr;textcolor(10);
line; gotoxy(1,2);textcolor(15); center('Digite o nome Cadastramen
to de Registro ');
textcolor(10);line; line; textcolor(15);
append(hospede);
Begin {relogio em tempo real}
gotoxy(63,2);Write ('Hora atual:');
gettime(hh,mm,ss,cs);
gotoxy(68,2); Write (hh,':',mm);
end;
gotoxy(3,5);write('NOME: ');readln(Nomea);gotoxy(3,7);write('JA HOSPEDOU NO HOTE
L:');readln(HOS);
if HOS = 'N' then HOSP := 'NAO CADASTRADO ';if HOS = 'n' then HOSP := 'NAO CADAS
TRADO';
if HOS = 'NAO' then HOSP := 'NAO CADASTRADO';if HOS = 'nao' then HOSP := 'NAO CA
DASTRADO';
if HOS = 'S' then HOSP := 'JA CADASTRADO';if HOS = 's' then HOSP := 'JA CADASTRA
DO';
if HOS = 'SIM' then HOSP := 'JA CADASTRADO';if HOS = 'nao' then HOSP := 'JA CADA
STRADO';
gotoxy(3,7);write('POSSIVELMENTE O HOSPEDE: ');write(HOSP);
gotoxy(3,9);write('MASC.: ');readln(NAS1);gotoxy(13,9);write('MM: ');readln(NAS2
);
gotoxy(20,9);write('AA: ');readln(NAS3);
gotoxy(3,9);write('DATA DE NASC.: ',NAS1,'/',NAS2,'/',NAS3);
gotoxy(35,9);write('APTO: [ 1 A 4 ] ');readln(APTO);
if APTO = 1 then LAPTO := 'SIMPLES';if APTO = 2 then LAPTO := ' LUXO';
if APTO = 3 then LAPTO := 'MASTER';if APTO = 4 then LAPTO := 'PRESIDENCIAL';
if APTO > 4 then LAPTO := 'FATAL ERRO ';
if APTO < 1 then LAPTO :='FATAL ERRO ';
gotoxy(35,9);write('CATEGORIA : ');write(LAPTO);
gotoxy(3,11);write('CPF: ');readln(CPF);gotoxy(18,11);write('- ');readln(DIGT);
gotoxy(25,11);write('RG: ');readln(RG);
gotoxy(40,11);write('DDD: ');read(DDD);gotoxy(48,11);write('FONES: ');readln(FON
E);
gotoxy(64,11);write('FONES: ');readln(FONEA);
gotoxy(3,13);write('QUANTOS DIAS DE PERMANENCIA: ');readln(PER);
if PER <= 0 then PER := 1;
gotoxy(3,13);write('QUANTOS DIAS DE PERMANENCIA: ',PER);
gotoxy(46,13);write('QUANTOS APTO: ');readln(QAPTO);
if QAPTO <= 0 then QAPTO := 1;
gotoxy(46,13);write('QUANTOS APTO: ',QAPTO);
gotoxy(3,15);write('ANIMAIS DOMESTICOS: SIM ou NAO ');readln(ANI);
if ANI = 'N' then QUAN := 0;if ANI = 'n' then QUAN := 0;if ANI = 'NAO' then QUAN
:= 0;
if ANI = 'nao' then QUAN := 0;if ANI = 'S' then QUAN := 1;if ANI = 's' then QUAN
:= 1;
if ANI = 'SIM' then QUAN := 1;if ANI = 'nao' then QUAN := 1;
gotoxy(46,15);write('QUANTOS: ');write(QUAN);
gotoxy(3,17);write('DESEJA UTILIZAR A GARAGEM: SIM ou NAO ');readln(GAR);
gotoxy(30,17);write('CADASTRE A PLACA: ');readln(ESTAC);
gotoxy(3,19);write('DD: ');readln(DD);gotoxy(10,19);write('MM: ');readln(M);
gotoxy(17,19);write('AA: ');readln(AA);
gotoxy(3,19);write('MINAS-GERAIS: ',DD,'/',M,'/',AA);
gotoxy(35,19);write('HORAS: ');readln(HORA);
writeln(hospede,Nomea);writeln(hospede,HOSP,' POSSUI CADASTRO NO HOTEL');
writeln(hospede,NAS1,'/',NAS2,'/',NAS3,' DATA DE NASCIMENTO'); writeln(hospede,A
PTO, ' OPCAO DO APARTAMENTO');
writeln(hospede,CPF, ' CPF');writeln(hospede,DIGT, ' DIGITO');
writeln(hospede,RG, ' RG');writeln(hospede,DDD,' DDD');writeln(hospede,FONE,' FO
NE');
writeln(hospede,FONEA,' CEL');writeln(hospede,PER,' DIAS DE PERMANENCIA');
writeln(hospede,QAPTO,' QUANTIDADE DE QUARTOS ALUGADOS'); writeln(hospede,ANI,'
ANIMAL DE ESTIMACAO');
writeln(hospede,QUAN,' QUANTIDADE DE ANIMAIS');writeln(hospede,GAR,' DESEJA UTIL
IZAR A GARAGEM');
writeln(hospede,ESTAC,' PLACA DO CARRO');
writeln(hospede,DD,'/',M,'/',AA);
writeln(hospede,HORA,' HORA DA RESERVA');
clrscr; textcolor(10);
line; gotoxy(1,2); center('VALOR A PAGAR'); line; line; textcolor(15);
if APTO = 1 then level :=120.00;
gotoxy(5,5); write('APARTAMENTO. VALOR A PAGAR: ',level:3:2);
if APTO = 2 then level :=230.00;
gotoxy(5,5); write('APARTAMENTO. VALOR A PAGAR: ',level:3:2);
if APTO = 3 then level :=410.00;
gotoxy(5,5); write('APARTAMENTO. VALOR A PAGAR: ',level:3:2);
if APTO = 4 then level :=750.00;
gotoxy(5,5); write('APARTAMENTO. VALOR A PAGAR: ',level:3:2);
pe := PER * level;
if PER > 0 then pe := pe;
gotoxy(5,7); write('SOMA DAS DIARIAS: ',pe:6:2);
tot := QAPTO * pe;
if QAPTO > 0 then tot := tot;
gotoxy(5,9); write('TOTAL A PAGAR (INCLUSO QUANTIDADE DE APARTAMENTOS): ',tot:6:
2);
writeln(hospede, tot:6:2,' TOTAL DA CONTA');
readln;
close(hospede);
end;
procedure EXIBIR;
var
LINHA : byte;
cb, bc : word;
begin
clrscr;
for bc := 1 to 79 do begin
textcolor(10); gotoxy(bc,1);write(#205); end;
gotoxy(1,1);write(#201);
gotoxy(80,1);write(#187);
for cb := 2 to 1000 do begin
gotoxy(1,cb); write(#186); end;
for cb := 2 to 1000 do begin
gotoxy(80,cb); write(#186); end;
gotoxy(1,24);write(#205); gotoxy(1,42); write(#205);gotoxy(1,60); write(#205);
gotoxy(1,78);write(#205);gotoxy(1,96);write(#205);gotoxy(1,114);write(#205);
gotoxy(1,132);write(#205);gotoxy(1,150);write(#205);gotoxy(1,168);write(#205);
gotoxy(2,100);textcolor(15); center('Apresentacao de Registros');
LINHA := 1;
reset(hospede);
while not eof(hospede) do
begin
readln(hospede, Nomea);
gotoxy( 3,LINHA+5); write(Nomea);
LINHA := LINHA + 1;
end;
READLN;
writexy(25,24,'Tecle algo para voltar ao menu');
TECLA := readkey;
READLN;
close(hospede);
end;
begin
OPCAO := '4';
assign(hospede,'hospede.DAT');
while (OPCAO <> '0') do
begin
clrscr;textcolor(10);line; gotoxy(1,2);center('Menu Principal');line;line;
textcolor(15);
gotoxy(28,8); write('[2] - RESERVAR VAGA');
gotoxy(28,10);write('[3] - FECHAMENTO DE CONTA');
gotoxy(28,16);write('[0] - EXIT');
gotoxy(28,20);write('Escolha uma opcao: ');
readln(OPCAO);
if (OPCAO <> '0') then
case OPCAO of
'2' : Cadastra;
'3' : Exibir;
else
gotoxy(27,24); writeln('Opcao invalida - Tecle algo');
OPCAO := readkey;
end;
end;
end;
{=========================sub-programa reserva de apartamentos============FIM==}
{=========================sub-programa cadastro de cpf=========================}
procedure arquivocpf;
var
cadcpf : text;
cpf : longint;
digito : byte;
nomec : string;
TECLA : char;
begin
append(cadcpf);
clrscr;
textcolor(10);
gotoxy(1,25);write(#200);gotoxy(1,1);write(#201);
gotoxy(80,25);write(#188);gotoxy(80,1);write(#187);
for I:= 2 to 79 do begin
gotoxy(I,1);write(#205);
end;
for I:= 2 to 24 do begin
gotoxy(80,I);write(#186);
end;
for I:= 2 to 24 do begin
gotoxy(1,I);write(#186);
end;
gotoxy(2,22);write('____________________________________________________________
__________________');
for I:= 2 to 79 do begin
gotoxy(I,25);write(#205);
end;
textcolor(15);
gotoxy(3,5);write('CPF: ');readln(cpf);
gotoxy(3,6);write('DIGTO: ');readln(digito);
gotoxy(3,8);write('NOME: ');readln(nomec);
writeln(cadcpf,cpf);
writeln(cadcpf,digito);
writeln(cadcpf,nomec);
close(cadcpf);
clrscr;
reset(cadcpf);
while not eof(cadcpf) do
begin
readln(cadcpf, cpf);
gotoxy(3,2); write(cpf);
gotoxy(3,12); writeln(digito);
gotoxy(3,3);writeln(nomec);
readln;
close(cadcpf);
exit;
end;
end;
procedure leitura;
var
cadcpf : text;
begin
clrscr;
assign(cadcpf, 'cadcpf.dat');
reset(cadcpf);
while not eof(cadcpf) do
begin
readln(cadcpf);
readln;
close(cadcpf);
end;
end;
{=========================sub-programa cadastro de cpf====================FIM==}
{=========================sub-programa center e line para molduras=============}
procedure center(mensagem : string);
var {moldura CENTER para o menu principal}
tamanho : integer;
begin
tamanho := 40 + length(mensagem) div 2;
writeln(mensagem:tamanho);
for L:= 2 to 79 do begin gotoxy(L,3);write(#205);
end;
end;
procedure line; {moldura LINE para o menu principal}
begin
textcolor(10);
for L:= 2 to 79 do begin gotoxy(L,1);write(#205); end;
for L:= 2 to 24 do begin gotoxy(80,L);write(#186); end;
for L:= 2 to 24 do begin gotoxy(1,L);write(#186); end;
for L:= 2 to 79 do begin gotoxy(L,25);write(#205); end;
gotoxy(1,25);write(#200);gotoxy(1,1);write(#201);
gotoxy(80,25);write(#188);gotoxy(80,1);write(#187);
end;
{=========================sub-programa center e line para molduras========FIM==}
{=========================sub-programa do menu principal para ajuda============}
procedure ajuda;
begin
clrscr;line;
gotoxy(3,3);write('O PROGRAMA PODE APRESENTAR PROBLEMA NA PRIMEIRA VEZ QUE VOCE
USA');
gotoxy(3,5);write('UMA FERRAMENTA; ISSO SE DA PELO FATO DE QUE SOMENTE OS ARQUIV
OS DE');
gotoxy(3,7);write('MENUS SAO CRIADOS AO INICIALIZAR O PROGRAMA, PARA EVITAR QUE
ESTE');
gotoxy(3,9);write('SINISTRO OCORRA TECLE O NUMERO "10" E PRESSIONE "ENTER" NO');
gotoxy(3,11);write('MENU PRINCIPAL, FAZENDO ISSO EVITARA QUE O MESMO OCORRA. VAL
E LEMBRAR');
gotoxy(3,13);write('QUE ESTA OPCAO NAO EXCLUI NEM ALTERA SEUS DADOS E COFIGURACO
ES PODENDO');
gotoxy(3,15);write('FAZER SEM MAIS PREOCUPACOES. PARA QUE O(S) ARQUIVO(S) SEJAM
DELETADOS');
gotoxy(3,17);write('VOCE TEM QUE ACESSAR A FERRAMENTA ESPECIFICA PARA O MESMO NO
');
gotoxy(3,19);write('MENU INTERNO UTILIZANDO SENHA DE ACESSO.');
readln; end;
{=========================sub-programa do menu principal para ajuda=======FIM==}
{=========================sub-programa cadastro de hospede=====================}
function pesquisar(x: string; y: byte): boolean;
var
a: byte;
pesquisa : boolean;
begin
pesquisa := false;
if y = 1 then
begin
clrscr; line; textcolor(15);
gotoxy(5,5);
write('Nome: ');
readln (x);
end;
seek(cadhotel, 0);
while not eof(cadhotel) do
begin
read(cadhotel, pagina);
if x = pagina.nome then
begin
pesquisa := true;
break;
end;
end;
if y = 1 then
if pesquisa = false then
begin
gotoxy(10,7);
write ('Nome nao cadastrado');
readln;
end
else
begin
gotoxy(5,7);
write('Rua: ', pagina.Rua);
gotoxy(5,9);
write('Numero: ', pagina.Numero);
gotoxy(5,11);
write('Bairro: ', pagina.Bairro);
gotoxy(5,13);
write('Cep: ', pagina.Cep);
gotoxy(5,15);
write('Telefone: ',pagina.Telefone);
gotoxy(5,17);
write('RG: ',pagina.RG);
gotoxy(5,19);
write('Observacao: ',pagina.OBS);
readln;
end;
pesquisar := pesquisa;
end;
procedure incluir;
var
alvo: string[35];
begin
clrscr; line;gotoxy(2,2); center('DADOS DO NOVO CLIENTE');textcolor(15);
gotoxy(5,5);
write('Nome: ');
readln(alvo);
if pesquisar(alvo, 0) = true then
begin
gotoxy(10,7);textcolor(12);
writeln('NAO PERMITIDO > NOME JA CADASTRADO');textcolor(10);
readln;
end
else
begin
pagina.nome := alvo;
gotoxy(5,7);
write('Rua: ');
readln(pagina.rua);
gotoxy(5,9);
write('Numero: ');
readln(pagina.numero);
gotoxy(5,11);
write('Bairro: ');
readln(pagina.bairro);
gotoxy(5,13);
write('Cep: ');
readln(pagina.cep);
gotoxy(5,15);
write('Telefone: ');
readln(pagina.Telefone);
gotoxy(5,17);
write('RG: ');
readln(pagina.RG);
gotoxy(5,19);
write('Observacao: ');
readln(pagina.OBS);
seek(cadhotel, filesize(cadhotel));
write(cadhotel, pagina);
end;
end;
{=========================sub-programa cadastro de hospede================FIM==}
{=========================sub-programa aprovacao de socio do clube hotel=======}
procedure associados;
var
idade: word;
nomeb : string;
DD1, M1, AA1 : integer;
OPCAO : char;
begin
clrscr;
textcolor(10);
gotoxy(1,25);write(#200);gotoxy(1,1);write(#201);
gotoxy(80,25);write(#188);gotoxy(80,1);write(#187);
for I:= 2 to 79 do begin
gotoxy(I,1);write(#205);
end;
for I:= 2 to 24 do begin
gotoxy(80,I);write(#186);
end;
for I:= 2 to 24 do begin
gotoxy(1,I);write(#186);
end;
for I:= 2 to 79 do begin
gotoxy(I,25);write(#205);
gotoxy(2,22);write('____________________________________________________________
__________________');
end;
textcolor(2);
gotoxy(3,5);write (' / ');gotoxy(3,6);write (' \\ / /'
);
gotoxy(3,7);write (' \ // ');
gotoxy(3,8);write ('\\ \ \\ / // / (_\|/')
;
gotoxy(3,9);write (' \ \ /// /// //');
gotoxy(3,10);write(' \\\\\ / // /');gotoxy(3,11);write(' \ \ // //');
gotoxy(3,12);write(' \ \ ///');
gotoxy(3,18);write(' \| /| \*/ | \| /| |
\ /| ');
gotoxy(3,19);write('\|/\\/ \ | \|/ \\|\ |/\|/// / / | \|/ \\|\ |/\
|///V\V)|\\/\//');
textcolor(6);
gotoxy(3,20);write('------------------------------------------------------------
----------------');
textcolor(14);gotoxy(30,23);textcolor(11);write('GUILHERME AUGUSTO RODRIGUES');
gotoxy(30,24);write('<Analise de Sistema-FACOMP> <Versao 1.0>');textcolo
r(15);
textcolor(6);
gotoxy(2,21);write('( ) ( )[ ( ) ( ) [] [] (0) (0) [][] ( ) ( ) ( )( )(
) ( ) [] []( ) [0]');
gotoxy(2,21);write('( )(0)[]( )( ) [0] ( ) ( )]( )(0( ) []( ) ( )[ ( ) ( ) ( [
] [](0)(0) [][](0)');
gotoxy(9,13);write('[°]');gotoxy(9,14);write('[°]');gotoxy(9,15);write('[°]');gotoxy(9
,16);write('[°]');
gotoxy(9,17);write('[°]');gotoxy(9,18);write('[°]');gotoxy(9,19);write('[°]');gotoxy(5
9,9);write('[]');
gotoxy(57,10);write('[][]');gotoxy(57,11);write('[][]');gotoxy(57,12);write('[][
]');gotoxy(57,13);write('[][]');
gotoxy(57,14);write('[][]');gotoxy(57,15);write('[][]');gotoxy(57,16);write('[][
]');gotoxy(57,17);write('[][]');
gotoxy(57,18);write('[][]');gotoxy(57,19);write('[][]');
textcolor(14);
gotoxy(65,3);write(' |');gotoxy(65,4);write(' \ | /');gotoxy(65,5);wr
ite(' ^');
gotoxy(65,6);write('--- < > ---');gotoxy(65,7);write(' V');gotoxy(65,8);
write(' / | \');
gotoxy(65,9);write(' |');
textcolor(13);
gotoxy(30,8);write('BOCAIUVA');gotoxy(35,9);write('RESORT');gotoxy(40,10);write(
'HOTEL');
readln;
clrscr;
textcolor(10);
gotoxy(1,25);write(#200);gotoxy(1,1);write(#201);
gotoxy(80,25);write(#188);gotoxy(80,1);write(#187);
for I:= 2 to 79 do begin
gotoxy(I,1);write(#205);
end;
for I:= 2 to 24 do begin
gotoxy(80,I);write(#186);
end;
for I:= 2 to 24 do begin
gotoxy(1,I);write(#186);
end;
for I:= 2 to 79 do begin
gotoxy(I,25);write(#205);
gotoxy(2,22);write('____________________________________________________________
__________________');
end;
textcolor(15);
gotoxy(5,8); write('[ENTER] - VERIFICACAO DE DADOS E LIBERACAO DE ACESSO');
readln(OPCAO);
begin
clrscr;
textcolor(10);
gotoxy(1,25);write(#200);gotoxy(1,1);write(#201);
gotoxy(80,25);write(#188);gotoxy(80,1);write(#187);
for I:= 2 to 79 do begin
gotoxy(I,1);write(#205);
end;
for I:= 2 to 24 do begin
gotoxy(80,I);write(#186);
end;
for I:= 2 to 24 do begin
gotoxy(1,I);write(#186);
end;
for I:= 2 to 79 do begin
gotoxy(I,25);write(#205);
gotoxy(2,22);write('____________________________________________________________
__________________');
end;
gotoxy(26,2);write('CLUBE RESORTE HOTEL');
gotoxy(2,5);write('Idade:');readln(idade);
gotoxy(38,5);write('Nome:');readln(nomeb);
gotoxy(3,19);write('DD: ');readln(DD1);gotoxy(10,19);write('MM: ');readln(M1);
gotoxy(17,19);write('AA: ');readln(AA1);
if idade < 18 then begin
gotoxy(2,16);write('O CADASTRO NAO AUTORIZADO. MENOR DE IDADE');
readln;
exit;
end;
if M1 > 12 then begin
gotoxy(15,12);
write('NOTA. Mes superior a 12.');
readln;
end;
if DD1 > 31 then begin
gotoxy(15,13);
write('NOTA. Dia superior a 31.');
readln;
end;
if AA1 > 1992 then begin
gotoxy(15,17);
write('NOTA: Observe se a idade esta correta.');
readln;
end;
clrscr;
gotoxy(2,5);write(idade);
gotoxy(2,7);write(Nomeb);
gotoxy(3,19);write('DATA NASC.: ',DD1,'/',M1,'/',AA1);
readln;
if idade >= 18 then begin
gotoxy(2,15);write('O CADASTRO FOI AUTORIZADO');
begin
Pesquisar('', 1);
exit;
end;
end;
end;
end;
{=========================sub-programa aprovacao de socio do clube hotel==FIM==}
{=========================sub-programa cadastro de hospede=====================}
procedure ordenar;
var
a, b, tamanho: word;
begin
tamanho := filesize(cadhotel) - 1;
for a := 1 to tamanho do
for b := tamanho downto a do
begin
seek(cadhotel, (b - 1));
read(cadhotel, pagina1);
seek(cadhotel, b);
read(cadhotel, pagina2);
if pagina1.nome > pagina2.nome then
begin
pagina3.nome := pagina1.nome;
pagina1.nome := pagina2.nome;
pagina2.nome := pagina3.nome;
end;
seek(cadhotel, (b - 1));
write(cadhotel, pagina1);
seek(cadhotel, b);
write(cadhotel, pagina2);
end;
end;
procedure listar;
begin
clrscr;
seek(cadhotel, 0);
while not eof(cadhotel) do
begin
read(cadhotel,pagina);
writeln(pagina.nome);
end;
readln;
end;
{=========================sub-programa cadastro de hospede================FIM==}
{=========================sub-programa do menu interno para recados============}
procedure segurancainterno;
type
recados = record
Recado_para: string[35];
Titulo: string[30];
Data_Hora: string;
Escreva_recado: string;
end;
arquivo = file of recados;
var
pagina: recados;
pagina1, pagina2, pagina3 : recados;
agenda: arquivo;
{=========================sub-programa do menu interno para recados=======FIM==}
{=========================sub-programa cadastro de colaboradores===============}
procedure cadastro;
var
ARQTXT : text;
codigo : integer;
nome : string[30];
idade : integer;
sexo : char;
salario : real;
dependentes : string[3];
TECLA : char;
OPCAO : char;
procedure CENTER(MENSAGEM : string); {moldura CENTER para o menu interno}
var
TAMANHO : integer;
begin
TAMANHO := 40 + length(MENSAGEM) div 2;
writeln(MENSAGEM:TAMANHO);
end;
procedure WRITEXY(X, Y : byte; MENSAGEM : string);
begin
gotoxy(X, Y); write(MENSAGEM);
end;
procedure LINE; {moldura LINE para o menu interno}
var
I : byte;
begin
for I := 1 to 80 do
write(#205);
gotoxy(1,23);
for I := 1 to 80 do
write(#205);
gotoxy(1,24);
write('=\_______________________________________________________________________
_____/=');
end;
procedure CADASTRA; {procedimento para a tela de cadastro e consulta}
var
i : integer;
begin
clrscr; textcolor(14); {troca de cor da fonte}
for i := 2 to 79 do
begin
gotoxy(i,5); write(#205);gotoxy(i,7); write(#205);gotoxy(i,9); write(#205);
end;
gotoxy(1,5);write(#201);gotoxy(1,7);write(#204);gotoxy(1,9);write(#200);gotoxy(8
0,5);write(#187);
gotoxy(80,7);write(#185);gotoxy(80,9);write(#188);gotoxy(20,7);write(#203);gotox
y(20,9);write(#202);
gotoxy(60,7);write(#203);gotoxy(60,9);write(#202);gotoxy(1,6);write(#186);gotoxy
(1,8);write(#186);
gotoxy(20,8);write(#186);gotoxy(60,8);write(#186);gotoxy(80,8);write(#186);gotox
y(80,6);write(#186);
textcolor(5);
append(ARQTXT);
writexy(3,6,'Codigo:');readln(codigo);writexy(20,6,'Nome:');readln(nome);
writexy(68,6,'Sexo:');readln(sexo);writexy(3,8,'Idade:');readln(idade);
writexy(22,8,'Salario R$');readln(salario);writexy(62,8,'Dependentes:');readln(d
ependentes);
writeln(ARQTXT, codigo);
writeln(ARQTXT, nome);
writeln(ARQTXT, sexo);
writeln(ARQTXT, idade);
writeln(ARQTXT, salario);
writeln(ARQTXT, dependentes);
writexy(25,24,'Tecle algo para voltar ao menu');
TECLA := readkey;
close(ARQTXT);
end;
procedure EXIBIR;
var
i : integer;
begin
clrscr; textcolor(12);
for i := 2 to 79 do
begin
gotoxy(i,1);write(#205);gotoxy(i,3);write(#205);gotoxy(i,14);write(#205);
end;
for i := 2 to 13 do
begin
gotoxy(1,i);write(#186);gotoxy(8,i);write(#186);gotoxy(34,i);write(#186);
gotoxy(40,i);write(#186);gotoxy(54,i);write(#186);gotoxy(67,i);write(#186);
gotoxy(80,i);write(#186);
end;
gotoxy(1,1);write(#201);gotoxy(1,3);write(#204);gotoxy(1,14);write(#200);
gotoxy(80,1);write(#187);gotoxy(80,3);write(#185);gotoxy(80,14);write(#188);
gotoxy(8,1);write(#203);gotoxy(34,1);write(#203);gotoxy(40,1);write(#203);
gotoxy(54,1);write(#203);gotoxy(67,1);write(#203);gotoxy(8,3);write(#206);
gotoxy(34,3);write(#206);gotoxy(40,3);write(#206);gotoxy(54,3);write(#206);
gotoxy(67,3);write(#206);gotoxy(8,14);write(#202);gotoxy(34,14);write(#202);
gotoxy(40,14);write(#202);gotoxy(54,14);write(#202);gotoxy(67,14);write(#202);
textcolor(5);
reset(ARQTXT);
while not eof(ARQTXT) do
begin
readln(ARQTXT, codigo);
readln(ARQTXT, nome);
readln(ARQTXT, sexo);
readln(ARQTXT, idade);
readln(ARQTXT, salario);
readln(ARQTXT, dependentes);
gotoxy(2,2); write('Codigo');
gotoxy(20,2);write('Nome');
gotoxy(35,2);write('Sexo');
gotoxy(44,2);write('Idade');
gotoxy(55,2);write('Salario R$');
gotoxy(68,2);write('Dependentes');
gotoxy(2,4);write(Codigo);
gotoxy(9,4);write(nome);
gotoxy(37,4);write(sexo);
gotoxy(44,4);write(idade);
gotoxy(56,4);write(salario:5:2);
gotoxy(72,4);write(dependentes);
end;
writexy(25,24,'Tecle algo para voltar ao menu');
TECLA := readkey;
close(ARQTXT);
end;
begin
OPCAO := '4';
assign(ARQTXT,'AGENDTXT.DAT');
while (OPCAO <> '0') do
begin
clrscr; textcolor(10);
line;
gotoxy(1,2);
center('Menu Principal');
line;
line; textcolor(15);
gotoxy(28, 8); write('[2] - CADASTRAR');
gotoxy(28,10); write('[3] - EXIBIR REGISTRO');
gotoxy(28,12); write('[0] - EXIT');
gotoxy(28,16); write('Escolha uma opcao: ');
readln(OPCAO);
if (OPCAO <> '0') then
case OPCAO of
'2' : Cadastra;
'3' : Exibir;
else
gotoxy(27,24); writeln('Opcao invalida - Tecle algo');
OPCAO := readkey;
end;
end;
end;
{=========================sub-programa cadastro de colaboradores==========FIM==}
{=========================sub-programa do menu interno para pesquisa===========}
function pesquisar(x: string; y: byte): boolean;
var
a: byte;
pesquisa : boolean;
procedure CENTER(MENSAGEM : string); {moldura CENTER para o menu interno}
var
TAMANHO : integer;
begin
TAMANHO := 40 + length(MENSAGEM) div 2;
writeln(MENSAGEM:TAMANHO);
end;
{moldura LINE para o menu interno}
procedure LINE;
var
I : byte;
begin
for I := 1 to 80 do
write(#205);
gotoxy(1,23);
for I := 1 to 80 do
write(#205);
gotoxy(1,24);
write('=\_______________________________________________________________________
_____/=');
end;
begin
pesquisa := false;
if y = 1 then
begin
clrscr;
line;
line;
gotoxy(2,2);
write('Recado para: ');readln (x);
line;
end;
seek(agenda, 0);
while not eof(agenda) do
begin
read(agenda, pagina);
if x = pagina.Recado_para then
begin
pesquisa := true;
break;
end;
end;
if y = 1 then
if pesquisa = false then
begin
gotoxy(10,5);
write ('nome nao encontrado');
readln;
end
else
begin
gotoxy(10,6);
write('Titulo: ', pagina.Titulo);
gotoxy(10,8);
write('Data_Hora: ', pagina.Data_Hora);
gotoxy(10,14);
write('Recado para voce: ', pagina.Escreva_recado);
readln;
end;
pesquisar := pesquisa;
end;
{=========================sub-programa do menu interno para pesquisa======FIM==}
procedure LINE; {moldura LINE para o menu interno}
var
I : byte;
begin
for I := 1 to 80 do
write(#205);
gotoxy(1,23);
for I := 1 to 80 do
write(#205);
gotoxy(1,24);
write('=\_______________________________________________________________________
_____/=');
end;
procedure CENTER(MENSAGEM : string); {moldura CENTER para o menu interno}
var
TAMANHO : integer;
begin
TAMANHO := 40 + length(MENSAGEM) div 2;
writeln(MENSAGEM:TAMANHO);
end;
{=========================sub-programa do menu interno inclui recados==========}
procedure incluir;
var
alvo: string[35];
begin
clrscr; textcolor(10);
line;line;line;textcolor(15);
gotoxy(10,5);
write('Recado para: ');readln(alvo);
if pesquisar(alvo, 0) = true then
begin
gotoxy(10,8);
writeln('nome ja cadastro');
readln;
end
else
begin
pagina.Recado_para := alvo;
gotoxy(10,7);
write('Titulo: ');
readln(pagina.Titulo);
gotoxy(10,9);
write('Data_Hora: ');
readln(pagina.Data_Hora);
gotoxy(10,13);
write('Escreva_recado: ');
readln(pagina.Escreva_recado);
seek(agenda, filesize(agenda));
write(agenda, pagina);
end;
end;
{=========================sub-programa do menu interno inclui recados=====FIM==}
{=========================sub-programa do menu interno ordenar recados=========}
procedure ordenar;
var
a, b, tamanho: word;
begin
tamanho := filesize(agenda) - 1;
for a := 1 to tamanho do
for b := tamanho downto a do
begin
seek(agenda, (b - 1));
read(agenda, pagina1);
seek(agenda, b);
read(agenda, pagina2);
if pagina1.Recado_para > pagina2.Recado_para then
begin
pagina3.Recado_para := pagina1.Recado_para;
pagina1.Recado_para := pagina2.Recado_para;
pagina2.Recado_para := pagina3.Recado_para;
end;
seek(agenda, (b - 1));
write(agenda, pagina1);
seek(agenda, b);
write(agenda, pagina2);
end;
end;
{=========================sub-programa do menu interno ordenar recados====FIM==}
{=========================sub-programa do menu interno listar recados==========}
procedure listar;
begin
clrscr;
line;gotoxy(1,2);center('___Relacao da lista de recados___');
while not eof(agenda) do
begin
read(agenda,pagina);
writeln(pagina.Recado_para);
end;
gotoxy (1,23);line;line;
readln;
end;
{=========================sub-programa do menu interno listar recados=====FIM==}
{=========================sub-programa do menu interno protecao de tela========}
procedure chuva;
const
max = 1000;
vel = 20;
col = 79;
lin = 25;
tmp = 25;
got = 4;
type
matriz = array [1..max,1..max] of char;
procedure insere_moldura(var m:matriz);
var
i,j:integer;
begin
for i:=1 to lin do
for j:=1 to col do
begin
if (i>1) or (i<lin) then m[i,j] := ' ';
if (i=1) or (i=lin) then m[i,j] := '-';
if (j=1) or (j=col) then m[i,j] := '|';
end;
end;
procedure imprime(m:matriz);
var
i,j:integer;
begin
for i:=1 to lin do
begin
for j:=1 to col do
begin
write(m[i,j]);
end;
writeln;
end;
end;
procedure insere_gotas(var m:matriz);
var
i,posicao,gotas:integer;
begin
gotas:=random(got);
for i:=1 to gotas do
begin
textcolor(15);
posicao:=random(col-2);
if posicao > 2 then m[2,posicao]:='G';
end;
end;
procedure desce_gotas(var m:matriz);
var
i,j:integer;
begin
i:=lin-1;
while (i>=3) do begin
for j:=2 to col-1 do m[i,j]:=m[i-1,j];
i:=i-1;
end;
for j:=2 to col-1 do m[2,j]:=' ';
end;
procedure explode_gotas(var m:matriz);
var
i:integer;
begin
i:=2;
while (i<=col-1) do
begin
if (m[lin-1,i] = 'G') then
begin
m[lin-1,i-1]:='G';
m[lin-1,i+1]:='G';
i:=i+2;
end
else i:=i+1;
end;
end;
procedure limpa_explosao(var m:matriz);
var
i:integer;
begin
for i:=2 to col-1 do
if (m[lin-1,i]='G') then
m[lin-1,i]:=' ';
end;
var
tela:matriz;
i:integer;
begin
randomize;
insere_moldura(tela);
for i:=1 to tmp do
begin
clrscr;
insere_gotas(tela);
desce_gotas(tela);
explode_gotas(tela);
imprime(tela);
delay(vel);
limpa_explosao(tela);
end;
end;
procedure Protecao_de_tela;
var
col,lin,ql,cont,aux:integer;
letra:char;
opcao : byte;
begin
clrscr;textcolor(10); line;line;line; textcolor(15);
gotoxy (2,5);
write('[1] - MATRIX');
gotoxy (2,7);
write('[2] - CHUVA');
gotoxy (2,21);
write('[0] - Sair');
gotoxy (68,20);
write ('[][][][][][]');
gotoxy (68,21);
write ('[]');
gotoxy (78,21);
write ('[]');
gotoxy (68,22);
write ('[][][][][][]');
gotoxy(70,21);
write('Opcao:');
read(opcao);
if opcao = 2 then
begin
chuva;
end;
if opcao = 1 then
begin
Clrscr;
Repeat
col:=1+Random(79);
lin:=1+Random(23);
ql:= Random(10);
for cont:= lin to lin+ql do
Begin
if cont<24 then
Begin
letra:= chr(Random(255));
for aux:=1 to 2 do
Begin
if aux= 1 Then
Textcolor(10)
else
Textcolor(2);
gotoxy(col,cont);
write(letra);
delay(1);
end;
end;
end;
until keypressed;
end;
textcolor(15);
clrscr;
end;
{=========================sub-programa do menu interno protecao de tela===FIM==}
{=========================sub-programa do menu interno para ler recados========}
procedure senha;
var
u :integer;
senha : string;
opcao : byte;
begin
u := 1;
while (u <= 6) do begin
clrscr;
line;gotoxy(1,2);
center('BEM VINDO AO GERENCIADOR DOMESTICO!');line;line;
begin
gotoxy (36,12);
write ('[][][][][][][]');
gotoxy (36,13);
write ('[]');
gotoxy (48,13);
write ('[]');
gotoxy (36,14);
write ('[][][][][][][]');
gotoxy (38,13);
end;
readln (senha);
if senha='facomp 2.0'then {senha para ler recados}
begin
textcolor (15);
gotoxy (35,18);
write('ACESSO CONCEDIDO');
clrscr; textcolor(10);
line;gotoxy(1,2);
center('ACESSO TOTAL');line;line; textcolor(15);
gotoxy (2,5);
write('[1] - LER RECADO');
gotoxy (2,21);
write('[0] - Sair');
gotoxy (68,20);
write ('[][][][][][]');
gotoxy (68,21);
write ('[]');
gotoxy (78,21);
write ('[]');
gotoxy (68,22);
write ('[][][][][][]');
gotoxy(70,21);
write('Opcao:');
readln(opcao);
if opcao = 0 then
begin
exit;
end;
if opcao = 1 then
begin
Pesquisar('', 1);
exit;
end;
end;
if senha<>'facomp 2.0'then
begin
gotoxy (35,18);
write('ACESSO NAO PERMITIDO');
delay(800);
if u = 3 then begin
textcolor(4);
gotoxy(2,20);
write('RESTAM APENAS "DUAS" TENTATIVAS.');delay(2000);
end;
if u = 4 then begin
textcolor(4);
gotoxy(2,19);
write
('ATENCAO! RESTA APENAS UMA TENTATIVA. SE ERRAR O SISTEMA SERA FECHADO E O ');
gotoxy(2,20);
write
('ARQUIVO SERA DESTRUIDO. POR FAVOR ENTRA EM CONTATO COM O SUPORTE TECNICO');
readln;
end;
if u = 5 then begin {apaga todos os dados (recados) do menu interno}
clrscr;
gotoxy(20,20);
write('APAGANDO ARQUIVOS...');delay(2000);
gotoxy(20,20);
write('SEU ARQUIVO FOI DELETADO COM SUCESSO!');
readln;
rewrite(agenda);
halt
end;
u := u + 1;
end;
end;
end;
{=========================sub-programa do menu interno para ler recados===FIM==}
{=========================sub-programa do menu interno para jogo===============}
procedure jogominas;
var
x, c, y, p, fp, ce, xp, cp, cs, xs, fb, xb, m: integer;
s : real;
ta, tb : byte;
I : integer;
begin
randomize;
x := random(3) + 5;
p := random(60) + 40;
m := random(50) + 10 * p;
fp := random(40) + 80;
ce := random(40) + 80;
c := 0;
s := 1;
y := 1;
repeat
textcolor(15);
xp := random(2000) + 2000;
cp := random(12) + 7;
clrscr;
for ta := 1 to 80 do
begin
gotoxy(ta,1); write('º'); gotoxy(ta,11); write('_'); gotoxy(ta,13); write('_');
gotoxy(ta,20); write('_'); gotoxy(ta,22); write('_'); gotoxy(ta,25); write('º');
gotoxy(ta,2); write('_');
end;
for tb := 2 to 24 do
begin
gotoxy(1,tb); write('º'); gotoxy(80,tb); write('º');
end;
gotoxy(40,2);
writeln('Ano: ', y);
writeln;
gotoxy(3,4);
writeln('Existem >[', p, ']< habitantes na colonia.');
gotoxy(3,5);
writeln('Voce dispoe de >[', x, ']< minas e R$ ', m);
gotoxy(3,6);
if s < 0.8 then
begin
textcolor(12);
writeln('O fator de satisfacao e>[',s:3:1,']<');
end
else
writeln('O fator de satisfacao e >[',s:3:1,']<.');
writeln;
textcolor(15);
gotoxy(3,7);
writeln('Suas minas produziram [', ce, '] toneladas cada uma.');
c := c + ce * x;
gotoxy(3,8);
writeln('Minerio em estoque: >[', c, ']< toneladas.');
writeln;
gotoxy(3,9);
writeln('Preco de venda do minerio: R$ ', cp, ' por tonelada.');
gotoxy(3,10);
writeln('Preco de venda das minas: R$ ', xp, ' por mina.');
writeln;
gotoxy(5,12);
writeln('\_____________________Vendas___________________________/');
repeat
gotoxy(3,15);
write(')Quantas toneladas de minerio vai vender ? ');
readln(cs);
until (cs >= 0) and (cs <= c);
c := c - cs;
m := m + cs * cp;
repeat
gotoxy(3,16);
write(')Quantas minas vai vender ? ');
readln(xs);
until (xs >= 0) and (xs <= x);
x := x - xs;
m := m + xs * xp;
writeln;
gotoxy(2,17);
writeln('\____________________________________Agora voce tem R$ ', m,'__________
_________/');
writeln;
gotoxy(3,21);
writeln('\_____________________Compras___________________________/');
repeat
gotoxy(3,19);
write(')Quanto quer gastar em comida (Aprox. R$ 100 por habitante) ? ');
readln(fb);
until (fb >= 0) and (fb <= m);
m := m - fb;
if (fb div p) > 120 then s := s + 0.1;
if (fb div p) < 80 then s := s - 0.2;
repeat
gotoxy(3,23);
write(')Quantas minas quer comprar ? ');
readln(xb);
until (xb >= 0) and ((xb * xp) <= m);
x := x + xb;
m := m - (xb * xp);
if s < 0.6 then
begin
clrscr;
textcolor(12);
gotoxy(5,25);
writeln('Os colonos se revoltaram - Fim de jogo');
I := 1;
while (I <= 17 ) do
begin
gotoxy(10,5);
writeln(' * * * * * ');
gotoxy(10,6);
writeln(' * * * * * * * * * * * ');
gotoxy(10,7);
writeln(' * * * * * * * * * ');
gotoxy(10,8);
writeln(' * * * * * * * * * * ');
gotoxy(10,9);
writeln(' * * * * * * * * ');
gotoxy(10,10);
writeln(' * * * * * ');
gotoxy(10,11);
write(' ');
gotoxy(20,17);
writeln(' * * * * * ');
gotoxy(20,18);
writeln(' * * * * * * * * * * ');
gotoxy(20,19);
writeln(' * * * * * * * * ');
gotoxy(20,20);
writeln(' * * * * * * * * * ');
gotoxy(20,21);
writeln(' * * * * * *');
gotoxy(20,22);
writeln(' * * * * * * * *');
if I = 0 then textcolor(4);if I = 1 then textcolor(12);if I = 2 then textcolor(4
);
if I = 3 then textcolor(4);if I = 4 then textcolor(12);if I = 5 then textcolor(4
);
if I = 6 then textcolor(4);if I = 7 then textcolor(12);if I = 8 then textcolor(4
);
if I = 9 then textcolor(4);if I = 10 then textcolor(12);if I = 11 then textcolor
(4);
if I = 12 then textcolor(4);if I = 13 then textcolor(12);if I = 14 then textcolo
r(4);
if I = 15 then textcolor(4);if I = 16 then textcolor(12);if I = 17 then textcolo
r(15);
delay(200);
I := I + 1;
end;
break;
end;
if s > 1.1 then
begin
ce := ce + random(20) + 1;
p := p + random(10) + 1;
end;
if s < 0.9 then
begin
ce := ce - random(20) + 1;
p := p - random(10) + 1;
end;
if (p div x) < 10 then
begin
clrscr;
textcolor(12);
gotoxy(5,25);
writeln('Excesso de trabalho - Fim do jogo');
I := 1;
while (I <= 17 ) do
begin
gotoxy(10,5);
writeln(' * * * * * ');
gotoxy(10,6);
writeln(' * * * * * * * * * * * ');
gotoxy(10,7);
writeln(' * * * * * * * * * ');
gotoxy(10,8);
writeln(' * * * * * * * * * * ');
gotoxy(10,9);
writeln(' * * * * * * * * ');
gotoxy(10,10);
writeln(' * * * * * ');
gotoxy(10,11);
write(' ');
gotoxy(20,17);
writeln(' * * * * * ');
gotoxy(20,18);
writeln(' * * * * * * * * * * ');
gotoxy(20,19);
writeln(' * * * * * * * * ');
gotoxy(20,20);
writeln(' * * * * * * * * * ');
gotoxy(20,21);
writeln(' * * * * * *');
gotoxy(20,22);
writeln(' * * * * * * * *');
if I = 0 then textcolor(4);if I = 1 then textcolor(12);if I = 2 then textcolor(4
);
if I = 3 then textcolor(4);if I = 4 then textcolor(12);if I = 5 then textcolor(4
);
if I = 6 then textcolor(4);if I = 7 then textcolor(12);if I = 8 then textcolor(4
);
if I = 9 then textcolor(4);if I = 10 then textcolor(12);if I = 11 then textcolor
(4);
if I = 12 then textcolor(4);if I = 13 then textcolor(12);if I = 14 then textcolo
r(4);
if I = 15 then textcolor(4);if I = 16 then textcolor(12);if I = 17 then textcolo
r(15);
delay(200);
I := I + 1;
end;
break;
end;
if p < 30 then
begin
clrscr;
textcolor(12);
gotoxy(5,25);
writeln('Populacao insuficiente - Fim do jogo');
I := 1;
while (I <= 17 ) do
begin
gotoxy(10,5);
writeln(' * * * * * ');
gotoxy(10,6);
writeln(' * * * * * * * * * * * ');
gotoxy(10,7);
writeln(' * * * * * * * * * ');
gotoxy(10,8);
writeln(' * * * * * * * * * * ');
gotoxy(10,9);
writeln(' * * * * * * * * ');
gotoxy(10,10);
writeln(' * * * * * ');
gotoxy(10,11);
write(' ');
gotoxy(20,17);
writeln(' * * * * * ');
gotoxy(20,18);
writeln(' * * * * * * * * * * ');
gotoxy(20,19);
writeln(' * * * * * * * * ');
gotoxy(20,20);
writeln(' * * * * * * * * * ');
gotoxy(20,21);
writeln(' * * * * * *');
gotoxy(20,22);
writeln(' * * * * * * * *');
if I = 0 then textcolor(4);if I = 1 then textcolor(12);if I = 2 then textcolor(4
);
if I = 3 then textcolor(4);if I = 4 then textcolor(12);if I = 5 then textcolor(4
);
if I = 6 then textcolor(4);if I = 7 then textcolor(12);if I = 8 then textcolor(4
);
if I = 9 then textcolor(4);if I = 10 then textcolor(12);if I = 11 then textcolor
(4);
if I = 12 then textcolor(4);if I = 13 then textcolor(12);if I = 14 then textcolo
r(4);
if I = 15 then textcolor(4);if I = 16 then textcolor(12);if I = 17 then textcolo
r(15);
delay(200);
I := I + 1;
end;
break;
end;
if random(10) < 1 then
begin
I := 1;
while (I <=20) do
begin
gotoxy(2,2);
write('_ _ _
_');
gotoxy(2,3);
write('\ \ / /***** **** * * ******** * **** ** * \ \
/ /');
gotoxy(2,4);
write(' \ \ / / * * * * * ** * * * * * \ \
/ /');
gotoxy(2,5);
write(' \ \/ / * ****** * * ** * * * * * * \ \/
/ ');
gotoxy(2,6);
write(' / /\ \ * * * * * ** * * * * * * / /\
\ ');
gotoxy(2,7);
write(' / / \ \ * * * * * ** * * * * ** / /
\ \');
gotoxy(2,8);
write('/_/ \_\***** * * **** ** * **** * * /_/
\_\');
write('
');
write('
');
if I = 1 then textcolor(12);if I = 2 then textcolor(10);if I = 3 then textcolor(
12);
if I = 4 then textcolor(10);if I = 5 then textcolor(12);if I = 6 then textcolor(
10);
if I = 7 then textcolor(12);if I = 8 then textcolor(10);if I = 9 then textcolor(
12);
if I = 10 then textcolor(10);if I = 11 then textcolor(4); if I = 12 then textcol
or(12);
if I = 13 then textcolor(4);if I = 14 then textcolor(12);if I = 15 then textcolo
r(4);
if I = 16 then textcolor(12);if I = 17 then textcolor(4);if I = 18 then textcolo
r(12);
if I = 19 then textcolor(4);if I = 20 then textcolor(12);
delay(200);
I := I + 1;
end;
textcolor(3);
gotoxy(5,25);
writeln('Vazamento radioativo... Muito mortos');
delay(200);
p := p div 2;
end;
if ce > 150 then
begin
writeln;
textcolor(12);
gotoxy(5,25);
writeln('Execesso de producao... Queda dos precos');
delay(2000);
ce := ce div 2;
end;
y := y + 1;
if y = 11 then
begin
writeln;
writeln('Parabens, voce chegou ao fim do seu mandato');
end;
until y > 10;
readln;
end;
{=========================sub-programa do menu interno para jogo==========FIM==}
{=========================sub-programa do menu interno para dieta==============}
procedure dieta;
var
block : text;
NOME : string[40];
DATA : string[10];
PES : byte;
ALT : single;
SOMATOTIPO : string[40];
CATEGORIA : string[10];
TECLA : char;
OPC : char;
blocka : text;
pescoco, torax, cintura, abdome, quadril, bracoD, bracoE, antebD, antebE,
coxaD, coxaE, pernaD, pernaE : string[4];
c, a, b, x, o, tbm, tbma, tbmb, tbmc, tbmd, tbme : real;
peso , altura, anos, d :longint;
opcao, r, s, t : byte;
I : integer;
procedure CENTER(MENSAGEM : string); {moldura CENTER para o menu interno}
var
TAMANHO : integer;
begin
TAMANHO := 40 + length(MENSAGEM) div 2;
writeln(MENSAGEM:TAMANHO);
end;
procedure WRITEXY(X, Y : byte; MENSAGEM : string);
begin
gotoxy(X, Y); write(MENSAGEM);
end;
procedure LINE; {moldura LINE para o menu interno}
var
I : byte;
begin
for I := 1 to 80 do
write(#205);
end;
procedure CADASTRA;
begin
clrscr; textcolor(10);
line; center('Cadastramento de Registro'); line;
gotoxy (1,23);
write ('=======================================================================
=========');
gotoxy (1,24);
write ('=\_____________________________________________________________________
_______/=');
gotoxy (1,25);
write ('=======================================================================
=========');
textcolor(15);
append(block);
writexy(10, 5, 'NOME ..............: '); readln(NOME);
writexy(10, 6, 'INICIO DO TREINO ..: '); readln(DATA);
writexy(10, 7, 'PESO ..............: '); readln(PES);
writexy(10, 8, 'ALTURA ............: '); readln(ALT);
writexy(10, 9, 'SOMATOTIPO ........: '); readln(SOMATOTIPO);
writexy(10, 10,'CATEGORIA .........: '); readln(CATEGORIA);
writeln(block,NOME); writeln(block,DATA); writeln(block,PES); writeln(block,ALT)
;
writeln(block,SOMATOTIPO); writeln(block,CATEGORIA);
writexy(25,24,'Tecle algo para voltar ao menu');
TECLA := readkey;
close(block);
end;
procedure EXIBIR;
var
LINHA : byte;
begin
clrscr; textcolor(10);
line; center('Apresentacao de Registros'); line;
gotoxy (1,23);
write ('=======================================================================
=========');
gotoxy (1,24);
write ('=\_____________________________________________________________________
_______/=');
gotoxy (1,25);
write ('=======================================================================
=========');
textcolor(15);
LINHA := 5;
reset(block);
while not eof(block) do begin
readln(block,NOME); readln(block,DATA); readln(block,PES); readln(block,ALT);
readln(block,SOMATOTIPO); readln(block,CATEGORIA);
gotoxy( 5,LINHA); write(NOME); gotoxy( 5,LINHA+2); write(DATA);
gotoxy( 5,LINHA+4); write(PES, ' KG'); gotoxy( 5,LINHA+6); write(ALT:2:2,' METRO
S');
gotoxy( 5,LINHA+8); write(SOMATOTIPO); gotoxy( 5,LINHA+10); write(CATEGORIA);
LINHA := LINHA + 1;
end;
writexy(25,24,'Tecle algo para voltar ao menu');
TECLA := readkey;
close(block);
end;

procedure MEDIDAS;
begin
clrscr; textcolor(10);
line; center('Cadastramento de Registro'); line;
gotoxy (1,23);
write ('=======================================================================
=========');
gotoxy (1,24);
write ('=\_____________________________________________________________________
_______/=');
gotoxy (1,25);
write ('=======================================================================
=========');
textcolor(15);
append(blocka);
writexy(10,5, 'MEDIDA DO BRACO DIREITO ........: '); readln(bracoD);
writexy(10,6, 'MEDIDA DO BRACO ESQUERDO .......: '); readln(bracoE);
writexy(10,7, 'MEDIDA DO ANTE-BRACO DIREITO ...: '); readln(antebD);
writexy(10,8, 'MEDIDA DO ANTE-BRACO ESQUERDO ..: '); readln(antebE);
writexy(10,9, 'MEDIDA DO TORAX ................: '); readln(torax);
writexy(10,10,'MEDIDA DA CINTURA ..............: '); readln(cintura);
writexy(10,11,'MEDIDA DA COXA DIREITA .........: '); readln(coxaD);
writexy(10,12,'MEDIDA DA COXA ESQUERDA ........: '); readln(coxaE);
writexy(10,13,'MEDIDA DA PERNA DIREITA ........: '); readln(pernaD);
writexy(10,14,'MEDIDA DA PERNA ESQUERDA .......: '); readln(pernaE);
writexy(10,15,'MEDIDA DO PESCOCO ..............: '); readln(pescoco);
writexy(10,16,'MEDIDA DO ABDOME ...............: '); readln(abdome);
writexy(10,17,'MEDIDA DO QUADRIL ..............: '); readln(quadril);
writeln(blocka, bracoD); writeln(blocka, bracoE); writeln(blocka, antebD);
writeln(blocka, antebE); writeln(blocka, torax); writeln(blocka, cintura);
writeln(blocka, coxaD); writeln(blocka, coxaE); writeln(blocka, pernaD);
writeln(blocka, pernaE); writeln(blocka, pescoco); writeln(blocka, abdome);
writeln(blocka, quadril);
writexy(25,24,'Tecle algo para voltar ao menu');
TECLA := readkey;
close(blocka);
end;
procedure Imc;
var
peso : byte;
altura : single;
x : real;
begin
clrscr; textcolor(10);
line; center('Calcule seu IMC'); line;
gotoxy (1,23);
write ('=======================================================================
=========');
gotoxy (1,24);
write ('=\_____________________________________________________________________
_______/=');
gotoxy (1,25);
write ('=======================================================================
=========');
textcolor(15);
gotoxy(10,6); writeln ('SEU PESO (EM Kg) .......: ');gotoxy(35,6); readln(peso);
gotoxy(10,8); writeln ('SUA ALTURA (EM METROS)..: ');gotoxy(35,8); readln(altura
);
gotoxy(10,12);
x := (peso / (altura * altura));
write('Seu IMC e : ',x:2:1);
readln;
end;
procedure mostrea;
var
LINHA : byte;
begin
clrscr; textcolor(10);
line; center('Apresentacao de Registros'); line;
gotoxy (1,23);
write ('=======================================================================
=========');
gotoxy (1,24);
write ('=\_____________________________________________________________________
_______/=');
gotoxy (1,25);
write ('=======================================================================
=========');
textcolor(15);
LINHA := 5;
reset(blocka);
while not eof(blocka) do
begin
readln(blocka, bracoD); readln(blocka, bracoE); readln(blocka, antebD);
readln(blocka, antebE); readln(blocka, torax); readln(blocka, cintura);
readln(blocka, coxaD); readln(blocka, coxaE); readln(blocka, pernaD);
readln(blocka, pernaE); readln(blocka, pescoco); readln(blocka, abdome);
readln(blocka, quadril);
gotoxy(5,LINHA);write ('BRACO D: ',bracoD, ' CM');
gotoxy(40,LINHA);write ('BRACO E: ',bracoE, ' CM');
gotoxy(5,LINHA+2);write ('ANTEB D: ',antebD, ' CM');
gotoxy(40,LINHA+2);write ('ANTEB E: ',antebE, ' CM');
gotoxy(5,LINHA+4);write ('TORAX : ',torax, ' CM');
gotoxy(40,LINHA+4);write ('CINTURA: ',cintura,' CM');
gotoxy(5,LINHA+6);write ('COXA D: ',coxaD, ' CM');
gotoxy(40,LINHA+6);write ('COXA E: ',coxaE, ' CM');
gotoxy(5,LINHA+8);write ('PERNA D: ',pernaD, ' CM');
gotoxy(40,LINHA+8);write ('PERNA E: ',pernaE, ' CM');
gotoxy(5,LINHA+10);write ('PESCOCO: ',pescoco,' CM');
gotoxy(40,LINHA+10);write('ABDOME : ',abdome, ' CM');
gotoxy(5,LINHA+12);write ('QUADRIL: ',quadril,' CM');

readln; LINHA := LINHA + 1;


end;
writexy(25,24,'Tecle algo para voltar ao menu');
TECLA := readkey;
close(blocka);
end;
procedure Sair;
begin
clrscr; textcolor(12);
writexy(10,10,'FECHANDO O PROGRAMA...');
writexy(20,12,'SALVANDO SUAS CONFIGURACOES...');delay(1000);
halt
end;
begin
OPC := '0';
assign(block, 'block.dat');
assign(blocka, 'blocka.dat');
while (OPC <> '4') do
begin
clrscr;textcolor(10);
line;
center('Menu Principal');
line;
gotoxy (1,23);
write ('=======================================================================
=========');
gotoxy (1,24);
write ('=\_____________________________________________________________________
_______/=');
gotoxy (1,25);
write ('======================================================================
==========');
textcolor(15);
gotoxy(5,6); write('[1] - CADASTRAR NOME');
gotoxy(5,8); write('[2] - EXIBIR CADASTROS');
gotoxy(5,10); write('[3] - ANTROPOMETRIA');
gotoxy(5,12); write('[4] - CALCULE SEU "TBM"');
gotoxy(5,14); write('[5] - VEJA SUAS MEDIDAS');
gotoxy(5,16); write('[7] - IMC');
gotoxy(5,21); write('[0] - SAIR DO PROGRAMA');
gotoxy(5,24); write('Escolha uma opcao: ');
readln(OPC);
if (OPC <> '4') then
case OPC of
'0' : Sair;
'1' : Cadastra;
'2' : Exibir;
'3' : Medidas;
'5' : mostrea;
'7' : Imc;

else
gotoxy(27,24); writeln('Opcao invalida - Tecle algo');
OPC := readkey;
end;
end;
I := 1;
while (I <= 10) do
begin
clrscr;
if I = 2 then textcolor(9);if I = 3 then textcolor(13);if I = 4 then textcolor(1
0);
if I = 5 then textcolor(5);if I = 6 then textcolor(11);if I = 7 then textcolor(6
);
if I = 8 then textcolor(12);if I = 9 then textcolor(14);if I = 10 then textcolor
(15);
for r := 1 to 80 do
begin
gotoxy (r,1); write ('*');gotoxy (r,12); write ('*'); gotoxy(r,18); writeln('
_');
end;
for s := 1 to 11 do
begin
gotoxy (1,s); write ('*'); gotoxy (80,s); write ('*');
end;
for t := 13 to 18 do
begin
gotoxy(1,t); writeln('º'); gotoxy(80,t); writeln('º');
end;
gotoxy(30,14); writeln('GUILHERME AUGUSTO RODRIGUES');
gotoxy(30,16); writeln('<Analise de Sistema-FACOMP>');
gotoxy(30,17); writeln(' Versao 1.0');
gotoxy(15,2); writeln (' ABOMAI_Project ');
gotoxy(15,4); writeln(' * * * * * * * * * * * * * *');
gotoxy(15,5); writeln('* * * * * * * * * * * * ');
gotoxy(15,6); writeln('* * * * * * * * * * * * * * * * *');
gotoxy(15,7); writeln('* * * * * * * * * * *');
gotoxy(15,8); writeln('* * * * * * * * * * * *');
gotoxy(15,9); writeln('* * * * * * * * *');
gotoxy(55,18); writeln('PLEASE WAY. CARGANDO...');
gotoxy (1,23);
write ('==================================================================
===============');
gotoxy (1,24);
write ('°°°°°°°°');
gotoxy (1,25);
write ('====================================================================
============');
if I = 2 then
begin
gotoxy (9,24);
write ('°°°°°°°°');
end;
if I = 3 then
begin
gotoxy (1,24);
write ('°°°°°°°°°°°°°°°°°°°°°°°°');
end;
if I = 4 then
begin
gotoxy (1,24);
write ('°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°');
end;
if I = 5 then
begin
gotoxy (1,24);
write ('°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°');
end;
if I = 6 then
begin
gotoxy (1,24);
write ('°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°');
end;
if I = 7 then
begin
gotoxy (1,24);
write ('°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°');
end;
if I = 8 then
begin
gotoxy (1,24);
write ('°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°');
end;
if I = 9 then
begin
gotoxy (1,24);
write ('°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°');
end;
if I = 10 then
begin
gotoxy (1,24);
write ('°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
gotoxy(45,18); writeln('TANKS FOR WAY...DOWNLOAD COMPLETE ');
end;
delay(200);
I := I + 1;
if I = 10 then
delay(2000);
end;
begin
clrscr;
for r := 1 to 80 do
begin
gotoxy (r,1);textcolor(10); write ('°'); gotoxy (r,25); write ('°'); gotoxy(r,15)
; writeln('_');
textcolor(15);
end;
begin
gotoxy(6,5); write ('Entre com o seu peso (Em KG): '); readln (peso);
gotoxy(6,7); write ('Entre com a sua altura (Em CM): '); readln (altura);
gotoxy(6,9); write ('Entre com sua idade (Em anos): '); readln (anos);
writeln;
end;
begin
a := 13.7 * peso;
b := 5 * altura;
c := 6.8 * anos;
d :=66;
x := ((d + (a + b)) - c);
gotoxy(6,13); write ('O SEU TMB: ',x:7:0);
gotoxy(1,17);
write (')O TMB E UMA TAXA DE METABOLISMO BASAL. EQUACAO DE HARRIS BENEDICT PARA
HOMENS.');
gotoxy(1,19);
write (')SENDO UMA FORMULA MUITO PRECISA PARA SABER A NECESSIDADE CALORICA DIARI
A.');
gotoxy(1,21);
write (')A INGESTAO INSUFICIENTE DE CALORIAS TORNA IMPOSSIVEL O GANHO DE MASSA M
USCULAR.');
readln;
end;
begin
clrscr;
end;
for s := 1 to 25 do
begin
gotoxy (1,s);textcolor(10); write ('°'); gotoxy (80,s); write ('°');
end;
for r := 2 to 79 do
begin
gotoxy (r,1);textcolor(10); write ('°'); gotoxy (r,25); write ('°'); gotoxy(r,20);
writeln('_');
textcolor(15);
end;
tbma := 1.2;
tbmb := 1.357;
tbmc := 1.55;
tbmd := 1.725;
tbme := 1.9;
gotoxy(6,3); write ('[1] - Pouco ou nenhum exercicio diario');
gotoxy(6,6); write ('[2] - Exercicio Leve - 1/3 dias por semana');
gotoxy(6,9); write ('[3] - Exercicio Moderado - 3/5 dias por semana');
gotoxy(6,12); write ('[4] - Exercicio Pesado - 6/7 dias por semana');
gotoxy(6,15); write ('[5] Exercicio Pesado todos os dias ou 2 treinos ao dia');
gotoxy(6,22); write ('Escolha uma opcao: ');readln(opcao);
if opcao = 1 then
begin
o := peso * 2;
tbm := x * tbma;
gotoxy(6,22);
write ('A sua necessidade calorica e: ',tbm:6:0,' Calorias Diarias');
gotoxy(6,24);
write ('A sua necessidade proteica e: ',o:4:0,' Proteinas Diarias');
end;
if opcao = 2 then
begin
o := peso * 2;
tbm := x * tbmb;
gotoxy(6,22);
write ('A sua necessidade calorica e: ',tbm:6:0,' Calorias Diarias');
gotoxy(6,24);
write ('A sua necessidade proteica e: ',o:4:0,' Proteinas Diarias');
end;
if opcao = 3 then
begin
o := peso * 2;
tbm := x * tbmc;
gotoxy(6,22);
write ('A sua necessidade calorica e: ',tbm:6:0,' Calorias Diarias');
gotoxy(6,24);
write ('A sua necessidade proteica e: ',o:4:0,' Proteinas Diarias');
end;
if opcao = 4 then
begin
o := peso * 2;
tbm := x * tbmd;
gotoxy(6,22);
write ('A sua necessidade calorica e: ',tbm:6:0,' Calorias Diarias');
gotoxy(6,24);
write ('A sua necessidade proteica e: ',o:4:0,' Proteinas Diarias');
end;
if opcao = 5 then
begin
o := peso * 2;
tbm := x * tbme;
gotoxy(6,22);
write ('A sua necessidade calorica e: ',tbm:6:0,' Calorias Diarias');
gotoxy(6,24);
write ('A sua necessidade proteica e: ',o:4:0,' Proteinas Diarias');
end;
readln;
begin
clrscr;
textcolor(15);
for r := 1 to 80 do
begin
gotoxy (r,1);textcolor(10); write ('°'); gotoxy (r,25); write ('°'); textcolor(15
);
end;
begin
gotoxy(1,4);
write (')PARA GARANTIR O GANHO DE MASSA MUSCULAR O ESSENCIAL E MANTER UMA INGES
TAO');
gotoxy(1,8);
write (' DE 2 A 3 GRAMAS DE PROTEINA POR Kg DO CORPO.');
gotoxy(1,12);
write (')EXEMPLO: UMA PESSOA COM 70Kg DEVE INGERIR 140 GRAMAS DE PROTEINA POR DI
A.');
gotoxy(1,16);
write(')SE VOCE DESEJA GANHAR MASSA MUSCULAR (HIPERTROFIA) DEVE CONSUMIR UM POUC
O MAIS.');
gotoxy(1,20);
write(')PARA GARANTIR QUE ESTA INGERIDO MAIS, ADICIONE 500 CALORIAS NO RESULTADO
TOTAL DA EQUACAO.');
readln;
end;
end;
end;
end;
{=========================sub-programa do menu interno para dieta=========FIM==}
{=========================sub-programa do menu interno para utilidades=========}
procedure ferramentas;
var
op : char;
c, a, b : real;
opcao, t : byte;
I : integer;
velocidade,tempo,consumo,distancia,litros,dinheiro,valor:real;
ta, tb : byte;
begin
clrscr;
line;gotoxy(1,2);center('MENU DE FERRAMENTAS');line;line;
gotoxy (2,5);
write('[1] - CALCULO DE CUSTO DE VIAGEM DE CARRO');
gotoxy (2,7);
write('[3] - CALCULADORA');
gotoxy (2,21);
write('[0] - Sair');
gotoxy (68,20);
write ('[][][][][][]');
gotoxy (68,21);
write ('[]');
gotoxy (78,21);
write ('[]');
gotoxy (68,22);
write ('[][][][][][]');
gotoxy(70,21);
write('Opcao:');
readln(opcao);
if opcao = 3 then
begin
I := 1;
while (I <= 100) do
begin
clrscr;
for ta := 1 to 80 do
begin
gotoxy(ta,1);write ('=');gotoxy(ta,2);write('°');gotoxy(ta,3);write('=');
gotoxy (ta,23);write ('=');gotoxy (ta,24);write ('°');gotoxy (ta,25);write ('=');
end;
for tb := 2 to 24 do
begin
gotoxy(1,tb);
write ('°');
gotoxy(80,tb);
write ('°');
end;
gotoxy(5,6);
write('Valor 1 => ');
readln(a);
gotoxy(5,7);
write('valor 2 => ');
readln(b);
gotoxy (31,14);
write ('[][][][][][][][][]');
gotoxy (31,15);
write ('[]');
gotoxy (47,15);
write ('[]');
gotoxy (31,16);
write ('[][][][][][][][][]');
gotoxy(33,15);
writeln('opcao:[+-/*]');
gotoxy(46,15);
op := readkey;
case op of
'+':c:=a+b;
'-':c:=a-b;
'/':c:=a/b;
'*':c:=a*b;
end;
gotoxy(2,18);
writeln(' \__________',c:10:0,' ___________________________________
_________/');
gotoxy(2,22);
write('Deseja sai? Se sim digite "0" : ');
gotoxy(35,22); read(t);
if t = 0 then
exit;
I := I + 1;
end;
end;
if opcao = 1 then
begin
Clrscr;
for ta := 1 to 80 do
begin
gotoxy(ta,1);write('º');gotoxy(ta,11);write('_');gotoxy(ta,13);write('_');
gotoxy(ta,2);write('_');gotoxy(ta,25);write('º');
end;
for tb := 2 to 24 do
begin
gotoxy(1,tb);write('º');gotoxy(80,tb);write('º');
end;
gotoxy(3,4);
write('DIGITE A VELOCIDADE (EM KM/H): ');readln(VELOCIDADE);
gotoxy(3,6);
write('DIGITE O TEMPO DO PERCURSO (EM MIN): ');readln(TEMPO);
gotoxy(3,8);
write('DIGITE O CONSUMO DO CARRO (EM LITROS): ');readln(CONSUMO);
gotoxy(3,10);
write('DIGITE O VALOR DO COMBUSTIVEL: ');readln(VALOR);
distancia := (velocidade / 60) * tempo;
litros := distancia / consumo;
dinheiro := litros * valor;
begin
textcolor (15);
gotoxy(4,12);
write('\__________________________________Resultado: _________________________
____/');
gotoxy(3,15);
writeln('Velocidade: ',velocidade:6:0,' KM/H');
gotoxy(3,17);
writeln('Vempo: ',tempo:6:0,' MIN');
gotoxy(3,19);
writeln('Distancia: ',distancia:6:0,' KM');
gotoxy(3,21);
writeln('Litros: ',litros:6:2,' CONSUMO EM LITROS');
gotoxy(3,23);
write('Desembolsar R$: ',dinheiro:4:2);
readln;
end;
end;
end;
{=========================sub-programa do menu interno para utilidades====FIM==}
{=========================sub-programa do menu interno pinta moldura===========}
procedure Cores;
var
tinta: integer;
begin
clrscr;
line;gotoxy(1,2);center('PINTE A TELA');line;line;
gotoxy (20,19);write ('[][][][][][]');gotoxy (20,20);write ('[]');gotoxy (30,20)
;
write ('[]');gotoxy (20,21);write ('[][][][][][]');gotoxy (15,12);
begin
write('Nota: para mudar a cor basta refazer o processo');
gotoxy(22,20);
write('Opcao:');
readln (tinta);
if tinta = 1 then
begin
textcolor (1);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 2 then
begin
textcolor (2);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 3 then
begin
textcolor (3);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 4 then
begin
textcolor (4);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 5 then
begin
textcolor (5);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 6 then
begin
textcolor (6);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 7 then
begin
textcolor (7);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 8 then
begin
textcolor (8);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 9 then
begin
textcolor (9);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 10 then
begin
textcolor (10);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 11 then
begin
textcolor (11);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 12 then
begin
textcolor (12);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 13 then
begin
textcolor (13);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 14 then
begin
textcolor (14);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
else
if tinta = 15 then
begin
textcolor (15);
gotoxy (15,15);
write('NOVA COR DE TEMA PRONTO!');delay(800);
end
end;
clrscr;
end;
{=========================sub-programa do menu interno pinta moldura======FIM==}
{=========================sub-programa do menu interno inicia jogo=============}
procedure game;
var
opcao : byte;
begin
clrscr; textcolor(10);
line;gotoxy(1,2);center('ENTRETERIMENTO');line;line;textcolor(15);
gotoxy (2,5);
write('[1] - JOGO MINAS DE BOCAIUVA');
gotoxy (2,9);
write('[0] - Sair');
gotoxy (68,20);
write ('[][][][][][]');
gotoxy (68,21);
write ('[]');
gotoxy (78,21);
write ('[]');
gotoxy (68,22);
write ('[][][][][][]');
gotoxy(70,21);
write('Opcao:');
readln(opcao);
if opcao = 1 then
begin
jogominas;
end;
end;
{=========================sub-programa do menu interno inicia jogo========FIM==}
{=========================sub-programa moldura dos arquivos existentes=========}
procedure moldarquivo;
begin
I := 1;
repeat
textcolor(12);gotoxy(20,20);
write('APAGANDO ARQUIVOS.');delay(20);
gotoxy(20,20);
write('APAGANDO ARQUIVOS .');delay(20);
gotoxy(20,20);
write('APAGANDO ARQUIVOS .');delay(20);
gotoxy(20,20);
write('APAGANDO ARQUIVOS ');delay(20);
if I = 6 then begin
gotoxy(20,20);write('SEU ARQUIVO FOI DELETADO COM SUCESSO!');delay(500);
end;
I := I + 1;
until I = 7;
end;
{=========================sub-programa moldura dos arquivos existentes====FIM==}
{=========================sub-programa que apaga os arquivos existentes========}
procedure ARQUIVOX;
var {para apagar o arquivo}
cadcpf : text;
begin
assign(cadcpf, 'cadcpf.dat');
rewrite(cadcpf);
clrscr;
close(cadcpf);
moldarquivo;
textcolor(15);
end;
procedure antropometria; {para apagar o arquivo}
var
blocka : text;
begin
assign(blocka, 'blocka.dat');
rewrite(blocka);
clrscr;
close(blocka);
moldarquivo;
textcolor(15);
end;
procedure arquivo_usuario; {para apagar o arquivo}
var
ARQTXT : text;
begin
assign(ARQTXT,'ARQTXT.DAT');
rewrite(ARQTXT);
clrscr;
close(ARQTXT);
moldarquivo;
textcolor(15);
end;
procedure arquivo_recado; {para apagar o arquivo}
var
agenda : text;
begin
assign(agenda, 'agenda.dat');
rewrite(agenda);
clrscr;
close(agenda);
moldarquivo;
textcolor(15);
end;
procedure dados_treino; {para apagar o arquivo}
var
block : text;
begin
assign(block, 'block.dat');
rewrite(block);
clrscr;
close(block);
moldarquivo;
textcolor(15);
end;
procedure reserva_apartamentos; {para apagar o arquivo}
var
hospede : text;
begin
assign(hospede,'hospede.DAT');
rewrite(hospede);
clrscr;
close(hospede);
moldarquivo;
textcolor(15);
end;
procedure cadhospedemenuinicial; {para apagar o arquivo}
var
cadhotel : text;
begin
assign(cadhotel,'cadhotel.DAT');
rewrite(cadhotel);
clrscr;
moldarquivo;
close(cadhotel);
exit;
end;
procedure seguranca;
var
senha : string;
op, opcao : byte;
begin
clrscr; textcolor(10);
line;gotoxy(1,2);
center('BEM VINDO A CENTRO DE SEGURANCA E CONFIGURACAO!');line;line; textcolor(1
5);
begin
gotoxy (36,12);
write ('[][][][][][][]');
gotoxy (36,13);
write ('[]');
gotoxy (48,13);
write ('[]');
gotoxy (36,14);
write ('[][][][][][][]');
gotoxy (38,13);
end;
readln (senha);
if senha<>'facomp 2.0'then {senha apagar o arquivo}
begin
textcolor(12);
gotoxy (35,18);
write('ACESSO NAO PERMITIDO');delay(800);
exit;
end;
if senha='facomp 2.0'then
begin
textcolor (10);
gotoxy (35,18);
write('ACESSO CONCEDIDO');delay(800);
clrscr;
line;line;line; textcolor(15);
gotoxy (2,5);
write('[2] - APAGAR TODOS OS ARQUIVOS');
gotoxy (2,21);
write('[0] - Sair');
gotoxy (68,20);
write ('[][][][][][]');
gotoxy (68,21);
write ('[]');
gotoxy (78,21);
write ('[]');
gotoxy (68,22);
write ('[][][][][][]');
gotoxy(70,21);
write('Opcao:');
readln(opcao);
if opcao = 2 then
begin
clrscr; textcolor(10);
line;line;line; textcolor(15); {relacao dos arquivos que podem ser apagados}
gotoxy (2,5);
write('[1] - APAGAR ARQUIVO DE RECADOS');
gotoxy (2,7);
write('[2] - APAGAR ARQUIVO DE CADASTRO DE COLABORADORES');
gotoxy (2,9);
write('[3] - APAGAR ARQUIVO DE DADOS DE TREINO');
gotoxy (2,11);
write('[4] - APAGAR ARQUIVO DE ANTROPOMETRIA');
gotoxy (2,13);
write('[5] - APAGAR ARQUIVO DE RESERVA DE APARTAMENTOS');
gotoxy( 2,15);
write('[6] - APAGAR ARQUIVO CADATRO DE HOSPEDES');
gotoxy( 2,17);
write('[7] - APAGAR ARQUIVO CADATRO DE CPF');
gotoxy (2,21);
write('[0] - Sair');
gotoxy (68,20);
write ('[][][][][][]');
gotoxy (68,21);
write ('[]');
gotoxy (78,21);
write ('[]');
gotoxy (68,22);
write ('[][][][][][]');
gotoxy(70,21);
write('Opcao:'); readln(op);
if op = 0 then
begin
exit;
end;
if op = 1 then
begin
arquivo_recado;
exit;
end;
end;
if op = 2 then
begin
arquivo_usuario;
exit;
end;
end;
if op = 3 then
begin
dados_treino;
exit;
end;
if op = 4 then
begin
antropometria;
exit;
end;
if op = 5 then
begin
reserva_apartamentos;
exit;
end;
if op = 6 then
begin
cadhospedemenuinicial;
exit;
end;
if op = 7 then
begin
ARQUIVOX;
exit;
end;
end;
{=========================sub-programa que apaga os arquivos existentes===FIM==}
{=========================MENU INTERNO=========================================}
procedure menu;
var
opcao: byte;
k, z: integer;
hh,mm,ss,cs:word;
begin
textcolor(15);
repeat
clrscr;
for k := 1 to 80 do begin
gotoxy(k,1);write(#205);gotoxy(k,3);write('_');gotoxy(k,25);write ('=');
gotoxy(k,24);write ('º');
end;
for z := 2 to 24 do begin
gotoxy(1,z);write('º');gotoxy(80,z);write('º');
end;
gotoxy (2,2);
textcolor(10);write (' ____MENU INTERNO____
');
textcolor(15);
gotoxy (2,5);
write('[1] - LER RECADO');
gotoxy (2,7);
write('[2] - INCLUIR RECADOS');
gotoxy (2,9);
write('[3] - JOGOS');
gotoxy (2,11);
write('[4] - DIETA PARA HOSPEDES');
gotoxy (2,13);
write('[5] - LISTA DE RECADOS');
gotoxy (2,15);
write('[6] - ORDENAR RECADO');
gotoxy (2,17);
write('[7] - CORES E TEMAS');
gotoxy (2,19);
write('[8] - FERRAMENTAS');
gotoxy (40,5);
write('[9] - COLABORADORES CADASTRADOS');
gotoxy (40,7);
write('[10] - PROTECAO DE TELA');
gotoxy (40,11);
write('[11] - CENTRAL DE SEGURANCA');
gotoxy (2,21);
write('[0] - Sair');
Begin
gotoxy(56,2);Write ('Hora atual:'); {relogio em tempo real}
Repeat
gettime(hh,mm,ss,cs);
gotoxy(68,2); Write (hh,':',mm,':',ss);
until keypressed;
end;
gotoxy (68,20);
write ('[][][][][][]');
gotoxy (68,21);
write ('[]');
gotoxy (78,21);
write ('[]');
gotoxy (68,22);
write ('[][][][][][]');
gotoxy(70,21);
write('Opcao:');readln(opcao);
case opcao of
1: senha;
2: incluir;
3: game;
4: dieta;
5: listar;
6: ordenar;
7: Cores;
8: ferramentas;
9: cadastro;
10: Protecao_de_tela;
11: seguranca;
end;
until (opcao = 0);
end;
procedure abrir;
begin
assign(agenda, 'agenda.dat');
{$I-}
reset(agenda);
{$I+}
if(IOResult <> 0) then
rewrite(agenda);
menu;
end;
begin{start}
abrir;
close(agenda);
end;
{=========================MENU INTERNO====================================FIM==}
{=========================MENU PRINCIPAL=======================================}
procedure menu;
var
opcao: byte;
hh,mm,ss,cs:word;
begin
Begin
textcolor(10);
gotoxy(1,25);write(#200);gotoxy(1,1);write(#201);
gotoxy(80,25);write(#188);gotoxy(80,1);write(#187);
for I:= 2 to 79 do begin
gotoxy(I,1);write(#205);
end;
for I:= 2 to 24 do begin
gotoxy(80,I);write(#186);
end;
for I:= 2 to 24 do begin
gotoxy(1,I);write(#186);
end;
for I:= 2 to 79 do begin
gotoxy(I,25);write(#205);
gotoxy(2,22);write('____________________________________________________________
__________________');
end;
textcolor(12);gotoxy(37,19);write('|Wi-Max'#169'|');
textcolor(15);

gotoxy(14,5);write ('[][]');
textcolor(14);gotoxy(16,6);write('[][]');gotoxy(20,8);write('[]');gotoxy(20,12);
write('[]');
gotoxy(20,16);write('[]');gotoxy(20,17);write('[]');gotoxy(12,19);write('[][][][
][]');
gotoxy(14,9);write('[][]');gotoxy(14,10);write('[][][]');gotoxy(14,14);write('[]
[][][]');
gotoxy(10,7);write('[][]');gotoxy(20,7);write('[]');
textcolor(3);gotoxy(10,15);write('°');
textcolor(15);gotoxy(11,15);write('][][][][][]');gotoxy(14,7);write('[][][]');
gotoxy(18,9);write('[][]');gotoxy(20,10);write('[]');
gotoxy(12,6);write ('[][]');
gotoxy(9,7);write ('');
gotoxy(9,8);write ('[°][][][][]');
gotoxy(9,9);write ('[°][]');
gotoxy(9,10);write('[°][]');
gotoxy(9,11);write('[°][][][][][]');
gotoxy(9,12);write('[°][][][][]');
gotoxy(9,13);write('[°][][][][][]');
textcolor(13);gotoxy(40,13);write('BOCAIUVA');gotoxy(45,14);write('PALACE');
gotoxy(50,15);write('HOTEL');textcolor(15);
gotoxy(9,14);write('[°][]');
gotoxy(9,15);write('[');
gotoxy(9,16);write('[°][][][][]');
gotoxy(9,17);write('[°][][][][]');
gotoxy(9,18);write('[°][][][][][]');
gotoxy(37,18);write('+_______+');
gotoxy(9,19);write('[°]');
textcolor(14);gotoxy(33,19);write('*');
textcolor(14);gotoxy(60,19);write('*'); textcolor(15);
textcolor(14);gotoxy(30,23);textcolor(11);write('GUILHERME AUGUSTO RODRIGUES');
gotoxy(30,24);write('<Analise de Sistema-FACOMP> <Versao 1.0>');textcolo
r(15);
textcolor(14); gotoxy(16,4);write('Y');textcolor(15);
gotoxy(3,20);write(' __ [°][][][][][] | |_______|ª | __
_____________');
gotoxy(2,21);write('\[°°]_[][][][__][][][]__(--)___|____|____|________________|__/|_
___/\____/\___');
repeat
textcolor(6);gotoxy(3,3);write ('< ( ( ((( ))) ) ) ) ) )
) )');
delay(10);
textcolor(15);gotoxy(3,3);write (' ( ( ((( ))) ) ) ) )
) )');
textcolor(15);
until keypressed;
readln;
end;
repeat
clrscr; line;gotoxy(2,2);center ('BOCAIUVA PALACE HOTEL ');textcolor(15);
gotoxy(5,5);
write('[1] - CADASTRAR HOSPEDE');
gotoxy(5,7);
write('[2] - DADOS DO CLIENTE');
gotoxy(5,9);
write('[3] - LISTA DE CLIENTES');
gotoxy(5,11);
write('[4] - ORDENAR A LISTA');
gotoxy(5,13);
write('[5] - RESERVA');
gotoxy(5,15);
write('[6] - ASSOCIE AO CLUBE');
gotoxy(40,5);
write('[7] - FUNCIONAMENTO E SEGURANCA');
gotoxy(40,7);
write('[8] - CPF CADASTRADO');
gotoxy(40,9);
write('[9] - LER CPF');
gotoxy(4,2);
write('AJUDA -> 11 <-');
gotoxy(5,21);
write('[0] - FECHAR O PRAGRAMA');
begin
gotoxy(56,2);Write ('Hora atual:'); {relogio em tempo real}
Repeat
gettime(hh,mm,ss,cs);
gotoxy(68,2); Write (hh,':',mm,':',ss);
until keypressed;
end;
gotoxy(45,22);write('Opcao: ');
readln(opcao);
case opcao of
1: incluir;
2: pesquisar('', 1);
3: listar;
4: ordenar;
5: reserva;
6: associados;
7: segurancainterno;
8: arquivocpf;
9: leitura;
10 : criaarquivo;
11 : ajuda;
end;
until (opcao = 0);
end;
procedure abrir;
begin
assign(cadhotel, 'cadhotel.dat');
{$I-}
reset(cadhotel);
{$I+}
if(IOResult <> 0) then
rewrite(cadhotel);
menu;
end;
{=========================MENU PRINCIPAL==================================FIM==}
begin {start}
abrir;
close(cadhotel);
I := 1;
repeat
textcolor(12);
gotoxy(45,25);write('SALVANDO SUAS CONFIGURACOES .');
delay(200);
gotoxy(45,25);write('SALVANDO SUAS CONFIGURACOES .');
delay(200);
gotoxy(45,25);write('SALVANDO SUAS CONFIGURACOES .');
gotoxy(45,25);write('SALVANDO SUAS CONFIGURACOES ');
delay(200);
I := I + 1;
until I = 7;
end. {fim do programa}

You might also like