Jump to content

Trabalho final !!!! [ Ajuda ]


Recommended Posts

Posted

Boas pessoal este é o meu primeiro tópico e queria tirar uma duvida, o meu trabalho final em pascal é sobre um Buffet de uma escola aonde recebe os alunos ( cartões electrónicos ) e os pedidos dos alunos e ate ver o saldo e a informação do aluno , a seguir vou meter o que o professor pediu me para eu meter  :

Guarde num ficheiro binário os dados (nome, idade e sexo) de diversas pessoas.

O programa disponibiliza o seguinte menu:

- Criar / inserir registos

- Adicionar registos

- Consultar um registo (pelo nº de inserção)

- Alterar registo

- Eliminar registo

- Listar todos

- (outras consultas).

rogram registos;
uses crt;
type registo =record
     nome:string[30];
     idade:integer;
     sexo:char;
end;
var fich1:file of registo;
    aluno:registo;
    op:char;
procedure menu;
begin
   clrscr;
   writeln('MENU');
   writeln('introduzir dados(apaga os ficheiros anteriores) -> 1 ');
   writeln('Adicionar dados -> 2 ');
   writeln('Consultar e alterar dados -> 3 ');
   writeln('Eliminar dados  -> 4 ');
   writeln('Mostrar todos   -> 5 ');
   Writeln('Listar Todos    -> 6 ');
   writeln('Terminar com o programa -> 0');
   write('Qual ‚ a sua op‡Æo -> ');
   repeat
     op:= readKey
   until op in ['0'..'6']
end;
function ExisteFicheiro : boolean;
begin
  assign(fich1,'e:\alunos4ever.dat');
  {$I-};
  reset (fich1);
  close(fich1);
  {$I+};
  ExisteFicheiro := (IoResult=0);
end;

procedure introduzir;
var c,n:integer;
begin
  clrscr;
  writeln('introduzir os dados');
  if ExisteFicheiro then
     reset (fich1)
  else
    rewrite (fich1);
  write('quantos registo vais introduzir?');
  readln(n);
  for c:=1 to n do
  begin
     write('nome: ');
     readln(aluno.nome);
     write('idade: ');
     readln(aluno.idade);
     write('Sexo: ');
     readln(aluno.sexo);
     seek(fich1, filesize(fich1));
     write(fich1, aluno);
  end;
  close(fich1);
end;

procedure adicionar;
var c,n:integer;
begin
  clrscr;
  writeln('introduzir os dados');
  assign(fich1,'e:\alunos4ever.dat');
  rewrite (fich1);
  write('quantos registo vais introduzir?');
  readln(n);
  for c:=1 to n do
  begin
     write('nome: ');
     readln(aluno.nome);
     write('idade: ');
     readln(aluno.idade);
     write('Sexo: ');
     readln(aluno.sexo);
     seek(fich1, filesize(fich1));
     write(fich1, aluno);
  end;
  close(fich1);
end;

procedure consultar;
var n:integer; k:char;
begin
clrscr;
if not ExisteFicheiro then
begin
   writeln('ficheiro Nao Existe');
   write('Clique Enter para continuar (menu)');
   repeat
   until ReadKey = #13
end
else
begin
   reset(fich1);
   Writeln('Consultar e alterar dados do seu ficheiro ');
   repeat
     write('N§ do registo a consultar ');
     writeln('Entre 1 e ', filesize(fich1));
     read(n);
   until (n>0) and (n<=filesize(fich1));
   seek (fich1, n-1);
   read(fich1,aluno);
   writeln('Nome: ',aluno.nome:10,' Idade: ',aluno.idade:4,' Sexo: ',aluno.sexo: 2 );
   write('Alterar os dados S/N -> ');
   repeat
     k:= upcase(readkey)
   until k in ['S','N'];
   writeln;
   if k = 'S' then
   begin
     writeln('Escreva o novo nome: ');
     readln(aluno.nome);
     readln(aluno.nome);
     writeln('escreva a nova idade: ');
     readln(aluno.idade);
     seek (fich1, n-1);
     write(fich1,aluno);
   end;
   close(fich1);
  end;
end;

procedure eliminar;
begin

end;

procedure mostrar;
begin
  ExisteFicheiro;
  reset(fich1);
  while not eof(fich1) do
   begin
    clrscr;
     read(fich1,aluno);
     writeln('Nome: ',aluno.nome);
     writeln('Idade: ',aluno.idade);
     writeln('Sexo: ',aluno.sexo);
     readln;
   end;
   close(fich1);
end;

procedure listar;
begin
  clrscr;
  if not ExisteFicheiro then
  begin
    writeln('ficheiro nao existe');
    write('tecle ENTER para ir ao menu');
    readln;
    repeat until readkey = #13
  end
  else
   begin
     reset(fich1);
     writeln('Listar Registos');
     write('Registos No Ficheiro: ');
     writeln(filesize(fich1));
     readln;
     while not eof (fich1) do
     begin
       read(fich1,aluno);
       write('NOME: ',aluno.nome:15);
       write('  IDADE: ',aluno.idade:4);
       write('   SEXO: ',aluno.sexo:2);
       readln;
     end;
     close(fich1);
     readln;
     writeln('Prime Enter Para Continuar Para O Menu');
     repeat until readkey = #13
end;
end;

begin
  clrscr;
  textbackground(1);
  repeat
    menu;
    case op of
      '1' : adicionar;
      '2' : introduzir;
      '3' : consultar;
      '4' : eliminar;
      '5' : mostrar;
      '6' : listar;
    end;
    until op = '0';

end.

foi um pekeno exemplo de um programa ke fiz a 2 semanas ]

[move]acha que me podiam ajudar neste trabalho final?  é ficheiros Binários [/move]

Posted

Afinal qual é a tua dúvida?

Só te podemos ajudar se explicares concretamente qual é a tua dúvida.

10 REM Generation 48K!
20 INPUT "URL:", A$
30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50
40 PRINT "404 Not Found"
50 PRINT "./M6 @ Portugal a Programar."

 

Posted

bem dizendo preciso de ajuda a criar o programa não tenho ideias para começar o programa , podiam a ajudarem a criar o programa ou mesmo começar ?!

Posted

assim digame sff como fazo o eliminar no seguinte programa ja tentei de tudo e nunca consegui dame sempre um erro bue estupido vou postar a seguir o programa:

program registos;
uses crt;
type registo =record
     nome:string[30];
     idade:integer;
     sexo:char;
end;
var fich1:file of registo;
    aluno:registo;
    op:char;
    activo:boolean;
procedure menu;
begin
   clrscr;
   writeln('MENU');
   writeln('introduzir dados(apaga os ficheiros anteriores) -> 1 ');
   writeln('Adicionar dados -> 2 ');
   writeln('Consultar e alterar dados -> 3 ');
   writeln('Eliminar dados  -> 4 ');
   writeln('Mostrar todos   -> 5 ');
   Writeln('Listar Todos    -> 6 ');
   writeln('Terminar com o programa -> 0');
   write('Qual ‚ a sua op‡Æo -> ');
   repeat
     op:= readKey
   until op in ['0'..'6']
end;
function ExisteFicheiro : boolean;
begin
  assign(fich1,'e:\alunos4ever.dat');
  {$I-};
  reset (fich1);
  close(fich1);
  {$I+};
  ExisteFicheiro := (IoResult=0);
end;

procedure introduzir;
var c,n:integer;
begin
  clrscr;
  writeln('introduzir os dados');
  if ExisteFicheiro then
     reset (fich1)
  else
    rewrite (fich1);
  write('quantos registo vais introduzir?');
  readln(n);
  for c:=1 to n do
  begin
     write('nome: ');
     readln(aluno.nome);
     write('idade: ');
     readln(aluno.idade);
     write('Sexo: ');
     readln(aluno.sexo);
     seek(fich1, filesize(fich1));
     write(fich1, aluno);
  end;
  close(fich1);
end;

procedure adicionar;
var c,n:integer;
begin
  clrscr;
  writeln('introduzir os dados');
  assign(fich1,'e:\alunos4ever.dat');
  rewrite (fich1);
  write('quantos registo vais introduzir?');
  readln(n);
  for c:=1 to n do
  begin
     write('nome: ');
     readln(aluno.nome);
     write('idade: ');
     readln(aluno.idade);
     write('Sexo: ');
     readln(aluno.sexo);
     seek(fich1, filesize(fich1));
     write(fich1, aluno);
  end;
  close(fich1);
end;

procedure consultar;
var n:integer; k:char;
begin
clrscr;
if not ExisteFicheiro then
begin
   writeln('ficheiro Nao Existe');
   write('Clique Enter para continuar (menu)');
   repeat
   until ReadKey = #13
end
else
begin
   reset(fich1);
   Writeln('Consultar e alterar dados do seu ficheiro ');
   repeat
     write('N§ do registo a consultar ');
     writeln('Entre 1 e ', filesize(fich1));
     read(n);
   until (n>0) and (n<=filesize(fich1));
   seek (fich1, n-1);
   read(fich1,aluno);
   writeln('Nome: ',aluno.nome:10,' Idade: ',aluno.idade:4,' Sexo: ',aluno.sexo: 2 );
   write('Alterar os dados S/N -> ');
   repeat
     k:= upcase(readkey)
   until k in ['S','N'];
   writeln;
   if k = 'S' then
   begin
     writeln('Escreva o novo nome: ');
     readln(aluno.nome);
     readln(aluno.nome);
     writeln('escreva a nova idade: ');
     readln(aluno.idade);
     seek (fich1, n-1);
     write(fich1,aluno);
   end;
   close(fich1);
  end;
end;

procedure eliminar;
var n :integer; activo:boolean;
begin
  reset(fich1);
  writeln('Quere desruir os dados de que seguirte dado: ');
  read(n);
  read(fich1,aluno);
  seek(fich1,n-1);
  aluno.activo:=false;
  write(fich1,aluno);

end;

procedure mostrar;
begin
  ExisteFicheiro;
  reset(fich1);
  while not eof(fich1) do
   begin
    clrscr;
     read(fich1,aluno);
     writeln('Nome: ',aluno.nome);
     writeln('Idade: ',aluno.idade);
     writeln('Sexo: ',aluno.sexo);
     readln;
   end;
   close(fich1);
end;

procedure listar;
begin
  clrscr;
  if not ExisteFicheiro then
  begin
    writeln('ficheiro nao existe');
    write('tecle ENTER para ir ao menu');
    readln;
    repeat until readkey = #13
  end
  else
   begin
     reset(fich1);
     writeln('Listar Registos');
     write('Registos No Ficheiro: ');
     writeln(filesize(fich1));
     readln;
     while not eof (fich1) do
     begin
       read(fich1,aluno);
       write('NOME: ',aluno.nome:15);
       write('  IDADE: ',aluno.idade:4);
       write('   SEXO: ',aluno.sexo:2);
       readln;
     end;
     close(fich1);
     readln;
     writeln('Prime Enter Para Continuar Para O Menu');
     repeat until readkey = #13
end;
end;

begin
  clrscr;
  textbackground(1);
  repeat
    menu;
    case op of
      '1' : adicionar;
      '2' : introduzir;
      '3' : consultar;
      '4' : eliminar;
      '5' : mostrar;
      '6' : listar;
    end;
    until op = '0';

end.

como fazo o eliminar por um numeroi do ficheiro binario a minha escolha ?

Posted

trane, antes de mais, peço-te que escrevas como deve ser de forma a que quem lê consiga perceber o que escreves.

Qual é o erro que te dá quando eliminas?

10 REM Generation 48K!
20 INPUT "URL:", A$
30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50
40 PRINT "404 Not Found"
50 PRINT "./M6 @ Portugal a Programar."

 

Posted

eu já tentei todas as formas mas nunca elimina, como agora aqui na minha escola estamos a dar Pascal , mas a matéria de ficheiros binários e eu queria saber como se elimina em ficheiros binários

Posted

trane, com essas descrições vagas nunca ninguém te vai poder ajudar.

Como tal, a única coisa que te posso dizer está ao mesmo nível de abstracção: carregas o ficheiro para memória, fazeres as operações que quiseres e depois gravares a informação actualizada para ficheiro.

10 REM Generation 48K!
20 INPUT "URL:", A$
30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50
40 PRINT "404 Not Found"
50 PRINT "./M6 @ Portugal a Programar."

 

Posted

yh vou postar a seguir :

program registos;
uses crt;
type registo =record
     nome:string[30];
     cartao:integer;
     pedido:string;

     activo:boolean;
end;
var fich1:file of registo;
    aluno:registo;
    op:char;
procedure menu;
begin
   clrscr;
   writeln(' ');
   writeln(' ');
   writeln('                                    MENU');
   writeln('                     Introduzir dados(apaga os ficheiros anteriores)  -> 1 ');
   writeln('                     Adicionar dados  ---------------------------------> 2 ');
   writeln('                     Consultar e alterar dados ------------------------> 3 ');
   writeln('                     Eliminar dados -----------------------------------> 4 ');
   writeln('                     Mostrar todos ------------------------------------> 5 ');
   Writeln('                     Listar Todos -------------------------------------> 6 ');
   writeln('                     Ordenar Dados ------------------------------------> 7 ');
   writeln('                     Alterar Dados ------------------------------------> 8 ');
   writeln('                     Terminar com o programa --------------------------> 0');
   write('                     Qual ‚ a sua op‡Æo -> ');
   repeat
     op:= readKey
   until op in ['0'..'8']
end;
function ExisteFicheiro : boolean;
begin
  assign(fich1,'e:\alunos4ever.dat');
  {$I-};
  reset (fich1);
  close(fich1);
  {$I+};
  ExisteFicheiro := (IoResult=0);
end;

procedure introduzir;
var c,n:integer;
begin
  clrscr;
  writeln('introduzir os dados');
  if ExisteFicheiro then
     reset (fich1)
  else
    rewrite (fich1);
  write('quantos registo vais introduzir?');
  readln(n);
  for c:=1 to n do
  begin
     write('nome: ');
     readln(aluno.nome);
     write('N£mero do cartÆo: ');
     readln(aluno.cartao);
     write('Pedido: ');
     readln(aluno.pedido);
     aluno.activo:=true;
     write(fich1, aluno);
  end;
  close(fich1);
end;

procedure adicionar;
var c,n:integer;
begin
  clrscr;
  writeln('introduzir os dados');
  assign(fich1,'e:\alunos4ever.dat');
  rewrite (fich1);
  write('quantos registo vais introduzir?');
  readln(n);
  for c:=1 to n do
  begin
     write('Nome: ');
     readln(aluno.nome);
     write('N§ CartÆo: ');
     readln(aluno.cartao);
     write('Pedido: ');
     readln(aluno.pedido);
     aluno.activo:=true;
     write(fich1, aluno);
  end;
  close(fich1);
end;

procedure consultar;
var n:integer; k:char;
begin
clrscr;
if not ExisteFicheiro then
begin
   writeln('ficheiro Nao Existe');
   write('Clique Enter para continuar (menu)');
   repeat
   until ReadKey = #13
end
else
begin
   reset(fich1);
   Writeln('Consultar e alterar dados do seu ficheiro ');
   repeat
     write('N§ do registo a consultar ');
     writeln('Entre 1 e ', filesize(fich1));
     read(n);
   until (n>0) and (n<=filesize(fich1));
   seek (fich1, n-1);
   read(fich1,aluno);
   writeln('Nome: ',aluno.nome:10,' N§ CARTÇO: ',aluno.cartao:10,' PEDIDO: ',aluno.pedido:10 );
   write('Alterar os dados S/N -> ');
   repeat
     k:= upcase(readkey)
   until k in ['S','N'];
   writeln;
   if k = 'S' then
   begin
     writeln('Escreva o novo nome: ');
     readln(aluno.nome);
     readln(aluno.nome);
     writeln('escreva a novo numero cartao: ');
     readln(aluno.cartao);
     writeln('escreve o novo pedido: ');
     readln(aluno.pedido);
     seek (fich1, n-1);
     write(fich1,aluno);
   end;
   close(fich1);
  end;
end;

procedure eliminar;
var n :integer; activo:boolean;
begin
   if not ExisteFicheiro then
    begin
      writeln('ficheiro Nao Existe');
      write('Clique Enter para continuar (menu)');
      repeat
      until ReadKey = #13
    end
   else
    begin
      reset(fich1);
      writeln(' Quer Eliminar qual dado ? : ');
      read(n);
      read(fich1,aluno);
      seek(fich1,n-1);
      aluno.activo:=false;
      write(fich1,aluno);
   end;

end;

procedure mostrar;
begin
  ExisteFicheiro;
  reset(fich1);
  while not eof(fich1) do
   begin
    clrscr;
     read(fich1,aluno);
     writeln('Nome: ',aluno.nome);
     writeln('N§ CartÆo: ',aluno.cartao);
     writeln('Pedido: ',aluno.pedido);
     writeln(aluno.activo);
     readln;
   end;
   close(fich1);
end;

procedure listar;
begin
  clrscr;
  if not ExisteFicheiro then
  begin
    writeln('ficheiro nao existe');
    write('tecle ENTER para ir ao menu');
    readln;
    repeat until readkey = #13
  end
  else
   begin
     reset(fich1);
     writeln('Listar Registos');
     write('Registos No Ficheiro: ');
     writeln(filesize(fich1));
     readln;
     while not eof (fich1) do
     begin
       read(fich1,aluno);
       write('NOME: ',aluno.nome:15);
       write('  N§ CARATÇO: ',aluno.cartao:10);
       write('   PEDIDO: ',aluno.pedido:10);
       readln;
     end;
     close(fich1);
     readln;
     writeln('Prime Enter Para Continuar Para O Menu');
     repeat until readkey = #13
end;
end;

procedure ordenar;
begin

end;

procedure alterar;
begin

end;

begin
  clrscr;
  textbackground(1);
  repeat
    menu;
    case op of
      '1' : adicionar;
      '2' : introduzir;
      '3' : consultar;
      '4' : eliminar;
      '5' : mostrar;
      '6' : listar;
      '7' : ordenar;
      '8' : alterar;
    end;
    until op = '0';

end.

programa todo

procedure eliminar;
var n :integer; activo:boolean;
begin
   if not ExisteFicheiro then
    begin
      writeln('ficheiro Nao Existe');
      write('Clique Enter para continuar (menu)');
      repeat
      until ReadKey = #13
    end
   else
    begin
      reset(fich1);
      writeln(' Quer Eliminar qual dado ? : ');
      read(n);
      read(fich1,aluno);
      seek(fich1,n-1);
      aluno.activo:=false;
      write(fich1,aluno);
   end;

end;

procedure eliminar;

Posted

ok, ja consegui fazer o eliminar , mas obrigado a todos por me terem tentado ajudar  :wallbash:  muito obrigado  ?

Desculpa lá não sermos adivinhos nem sabermos ler a mente!

Com explicações tão vagas querias o quê? Que te disséssemos que te faltava um ; na linha x?

10 REM Generation 48K!
20 INPUT "URL:", A$
30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50
40 PRINT "404 Not Found"
50 PRINT "./M6 @ Portugal a Programar."

 

Posted

bem o meu trabalho final é este :

program registos;
uses crt, Dos;
type registo =record
    nome:string[30];
    cartao:integer;
    pedido:string;

    activo:boolean;
end;

var fich1:file of registo;
   aluno:registo;
   op:char;
   var Year,Month,Day,Weekday : word;
   Hour,Minute,Second,Hundredths : word;

procedure menu;

begin
  clrscr;
  writeln(' ');
  writeln(' ');
  GetTime(Hour, Minute, Second, Hundredths);
  GetDate(Year, Month, Day, Weekday);
  Writeln('A Data : ',Day:2,'/',Month:2,'/',Year);
  Writeln('A Houra : ',Hour:2,':',Minute:2,':',Second:2);
  writeln('                                    MENU');
  writeln('                     Introduzir dados(apaga os ficheiros anteriores)  -> 1 ');
  writeln('                     Pedidos Existentes Nesta Escola-------------------> 2 ');
  writeln('                     Adicionar dados  ---------------------------------> 3 ');
  writeln('                     Consultar e alterar dados ------------------------> 4 ');
  writeln('                     Eliminar dados -----------------------------------> 5 ');
  writeln('                     Mostrar todos ------------------------------------> 6 ');
  Writeln('                     Listar Todos -------------------------------------> 7 ');
  writeln('                     Ordenar Dados ------------------------------------> 8 ');
  writeln('                     Alterar Dados ------------------------------------> 9 ');
  writeln('                     Terminar com o programa --------------------------> 0');
  write('                     Qual ‚ a sua op‡Æo -> ');
  repeat
    op:= readKey
  until op in ['0'..'9']
end;
function ExisteFicheiro : boolean;

begin
 assign(fich1,'e:\alunos4ever.dat');
 {$I-};
 reset (fich1);
 close(fich1);
 {$I+};
 ExisteFicheiro := (IoResult=0);
end;

procedure introduzir;
var c,n:integer;

begin
 clrscr;
 writeln('introduzir os dados');
 if ExisteFicheiro then
    reset (fich1)
 else
   rewrite (fich1);
 write('quantos registo vais introduzir?');
 readln(n);
 for c:=1 to n do
 begin
    write('nome: ');
    readln(aluno.nome);
    write('N£mero do cartÆo: ');
    readln(aluno.cartao);
    write('Pedido: ');
    readln(aluno.pedido);
    aluno.activo:=true;
    write(fich1, aluno);
 end;
 close(fich1);
end;

procedure adicionar;
var c,n:integer;

begin
 clrscr;
 writeln('introduzir os dados');
 assign(fich1,'e:\alunos4ever.dat');
 rewrite (fich1);
 write('quantos registo vais introduzir?');
 readln(n);
 for c:=1 to n do
 begin
    write('Nome: ');
    readln(aluno.nome);
    write('N§ CartÆo: ');
    readln(aluno.cartao);
    write('Pedido: ');
    readln(aluno.pedido);
    aluno.activo:=true;
    write(fich1, aluno);
 end;
 close(fich1);
end;


procedure consultar;
var n:integer; k:char;

begin
clrscr;
if not ExisteFicheiro then
begin
  writeln('ficheiro Nao Existe');
  write('Clique Enter para continuar (menu)');
  repeat
  until ReadKey = #13
end
else
begin
  reset(fich1);
  Writeln('Consultar e alterar dados do seu ficheiro ');
  repeat
    write('N§ do registo a consultar ');
    writeln('Entre 1 e ', filesize(fich1));
    read(n);
  until (n>0) and (n<=filesize(fich1));
  seek (fich1, n-1);
  read(fich1,aluno);
  writeln('Nome: ',aluno.nome:10,' N§ CARTÇO: ',aluno.cartao:10,' PEDIDO: ',aluno.pedido:10 );
  write('Alterar os dados S/N -> ');
  repeat
    k:= upcase(readkey)
  until k in ['S','N'];
  writeln;
  if k = 'S' then
  begin
    writeln('Escreva o novo nome: ');
    readln(aluno.nome);
    readln(aluno.nome);
    writeln('escreva a novo numero cartao: ');
    readln(aluno.cartao);
    writeln('escreve o novo pedido: ');
    readln(aluno.pedido);
    seek (fich1, n-1);
    write(fich1,aluno);
  end;
  close(fich1);
 end;
end;


procedure eliminar;
var n :integer; activo:boolean;

begin
  if not ExisteFicheiro then
   begin
     writeln('ficheiro Nao Existe');
     write('Clique Enter para continuar (menu)');
     repeat
     until ReadKey = #13
   end
  else
   begin
     reset(fich1);
     writeln(' Quer Eliminar qual dado ? : ');
     read(n);
     read(fich1,aluno);
     seek(fich1,n-1);
     aluno.activo:=false;
     write(fich1,aluno);
  end;

end;

procedure mostrar;

begin
 ExisteFicheiro;
 reset(fich1);
 while not eof(fich1) do
  begin
   clrscr;
    read(fich1,aluno);
    writeln('Nome: ',aluno.nome);
    writeln('N§ CartÆo: ',aluno.cartao);
    writeln('Pedido: ',aluno.pedido);
    writeln(aluno.activo);
    readln;
  end;
  close(fich1);
end;

procedure listar;

begin
 clrscr;
 if not ExisteFicheiro then
 begin
   writeln('ficheiro nao existe');
   write('tecle ENTER para ir ao menu');
   readln;
   repeat until readkey = #13
 end
 else
  begin
    reset(fich1);
    writeln('Listar Registos');
    write('Registos No Ficheiro: ');
    writeln(filesize(fich1));
    readln;
    while not eof (fich1) do
    begin
      read(fich1,aluno);
      write('NOME: ',aluno.nome:15);
      write('  N§ CARATÇO: ',aluno.cartao:10);
      write('   PEDIDO: ',aluno.pedido:10);
      readln;
    end;
    close(fich1);
    writeln('Prime Enter Para Continuar Para O Menu');
    repeat until readkey = #13
end;

end;


procedure ordenar;

begin
 clrscr;
 writeln('  ');
 writeln('Ordenar Os Dados Por Ordem Dos N£meros Dos Cartäes');
 writeln(' ');
 writeln(' ');
 readln;

end;


procedure alterar;

begin
 clrscr;
 writeln(' ');
 writeln('Alterar Dados');
 writeln(' ');
 readln;

end;


procedure pedidos;

begin
 clrscr;
 Writeln(' ');
 writeln(' ');
 writeln('                 /-----------------------------------\ ');
 writeln('                | PEDIDOS EXISTENTES NESTA ESCOLA     | ');
 writeln('                |                                     | ');
 writeln('                |        1- bebidas                   |  ');
 writeln('                |                                     |');
 writeln('                |              a) sumos naturais      |');
 writeln('                |              b) agua                |');
 writeln('                |                                     |');
 writeln('                |        2- sandes                    |    ');
 writeln('                |                                     | ');
 writeln('                |              a) mistas              |');
 writeln('                |              b) queijo              | ');
 writeln('                |              c) fiambre             | ');
 writeln('                |                                     |');
 writeln('                |        3- Gloseimas                 |');
 writeln('                 \------------------------------------/  ');
 writeln(' ');
 writeln('para introduzir estes dados no programa ter  de introduzir a letra e o n£mero.   exemplo: 1a');
 writeln(' ');
 readln;


end;



begin
 clrscr;
 textbackground(1);
 repeat
   menu;
   case op of
     '1' : adicionar;
     '2' : pedidos;
     '3' : introduzir;
     '4' : consultar;
     '5' : eliminar;
     '6' : mostrar;
     '7' : listar;
     '8' : ordenar;
     '9' : alterar;
   end;
   until op = '0';
   clrscr;
   writeln(' ');
   writeln('                     PROGRAMA REALIZADOR POR: Programas Da Quinta  ');
   Writeln('                               Grafico : Programas Da Quinta ');
   writeln(' ');
   writeln('                      Obrigado pela sua escolha  e volte sempre ');
   writeln(' ');
   writeln('By: filipe felisberto  ');
   readln;
end.

o problema é que me falta o alterar e ordenar , que vou deixar para trás

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.