Ir ao conteúdo
  • Comunicados

    • Gabriel Torres

      Seja um moderador do Clube do Hardware!   12-02-2016

      Prezados membros do Clube do Hardware, Está aberto o processo de seleção de novos moderadores para diversos setores ou áreas do Clube do Hardware. Os requisitos são:   Pelo menos 500 posts e um ano de cadastro; Boa frequência de participação; Ser respeitoso, cordial e educado com os demais membros; Ter bom nível de português; Ter razoável conhecimento da área em que pretende atuar; Saber trabalhar em equipe (com os moderadores, coordenadores e administradores).   Os interessados deverão enviar uma mensagem privada para o usuário @Equipe Clube do Hardware com o título "Candidato a moderador". A mensagem deverá conter respostas às perguntas abaixo:   Qual o seu nome completo? Qual sua data de nascimento? Qual sua formação/profissão? Já atuou como moderador em algo outro fórum, se sim, qual? De forma sucinta, explique o porquê de querer ser moderador do fórum e conte-nos um pouco sobre você.   OBS: Não se trata de função remunerada. Todos que fazem parte do staff são voluntários.
    • DiF

      Poste seus códigos corretamente!   21-05-2016

      Prezados membros do Fórum do Clube do Hardware, O Fórum oferece um recurso chamado CODE, onde o ícone no painel do editor é  <>     O uso deste recurso é  imprescindível para uma melhor leitura, manter a organização, diferenciar de texto comum e principalmente evitar que os compiladores e IDEs acusem erro ao colar um código copiado daqui. Portanto convido-lhes para ler as instruções de como usar este recurso CODE neste tópico:  
Adt

Run time error - Ajuda

Recommended Posts

http://pastebin.com/LzX3Pskw

Esse programa faz os três primeiros itens(cadastrar, consultar e excluir) mas os outros dois da um erro:

Runtime Error 5 at 0x00402e

0x0040202E

0x00402B1C

Qual o erro?! Ajuda por favor.

Editado por gandalfnho
Mensagem toda em negrito

Compartilhar este post


Link para o post
Compartilhar em outros sites

Vamos por partes:

1) Mude de compilador

Tente compilar no Turbo Pascal 7.1. Só precisa mudar poucas coisas. Nele o erro é mais explícito.

2) Evitar travamento de I/O

Você está invertendo os comandos... para NÃO travar, usa "{$I-}"...

[color=#0000ff]procedure[/color] [color=#000000]novo_arquivo[/color][color=#000000]([/color][color=#0000ff]var[/color] arq[color=#000000]:[/color]arquivo[color=#000000]);[/color]
[color=#0000ff]begin[/color]
[color=#000000]Assign[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#a31515]'C:\Users[/color][color=#a31515]\a[/color][color=#a31515]ndre\Desktop\PROGRAMAÇAO 1A.arq'[/color][color=#000000]);[/color]
[color=#008000]{$I+}[/color]
[color=#000000]reset[/color][color=#000000]([/color]arq[color=#000000]);[/color]
[color=#008000]{SI-}[/color]

O correto seria assim:

[color=#0000ff]procedure[/color] [color=#000000]novo_arquivo[/color][color=#000000]([/color][color=#0000ff]var[/color] arq[color=#000000]:[/color]arquivo[color=#000000]);[/color]
[color=#0000ff]begin[/color]
[color=#000000]Assign[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#a31515]'C:\Users[/color][color=#a31515]\a[/color][color=#a31515]ndre\Desktop\PROGRAMAÇAO 1A.arq'[/color][color=#000000]);[/color]
[color=#008000]{$I-}[/color]
[color=#000000]reset[/color][color=#000000]([/color]arq[color=#000000]);[/color]
[color=#008000]{$I+}[/color]

OBS.: Cuidado, o comando é com "$" (cifrão) e não com "S" (letra 's').

3) Tente usar um caminho relativo

Em vez dizer um caminho absoluto, tente colocar o arquivo no diretório padrão, ex.:

[color=#000000]Assign[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#a31515]'DADOS.arq'[/color][color=#000000]);[/color]

4) Identação do código

Cadê a identação do código? :D

***

Faça esses mudanças e teste novamente... mesmo com o seu compilador, veja se consegue verificar qual erro está dando.

PS: Se possível poste o código aqui no Fórum mesmo... Não se esquecendo da identação!!! ^_^

No aguardo.

Abraços

Editado por gandalfnho
Remoção do quote

Compartilhar este post


Link para o post
Compartilhar em outros sites
  • Autor do tópico
  • Cara, pelo amor de Deus, tu tem que me ajudar com esse negocio... ele é grande e eu preciso dele pra passar nessa cadeira por favor me ajuda... eu imploro

    http://pastebin.com/YLdCxfWe

    qual o erro mano, faz ele rodar tudo certinho na moral...

    Compartilhar este post


    Link para o post
    Compartilhar em outros sites
    Cara, pelo amor de Deus, tu tem que me ajudar com esse negocio... ele é grande e eu preciso dele pra passar nessa cadeira por favor me ajuda... eu imploro

    http://pastebin.com/YLdCxfWe

    qual o erro mano, faz ele rodar tudo certinho na moral...

    Olá,

    Desculpe a demora. Eu até tinha começado a ver o seu código, mas perdi o arquivo... (refazer é freud)...

    Em fim... Ainda precisa de ajuda?

    Abaixo peguei seu código original e identei (no meu padrão, é claro) e ajustei o código para torná-lo compilável!!! Nada mais!!!, já que não sei se você precisa ainda e também é você que terá que corrigir ^_^



    [color=#008000]{Criando registro do tipo DATA}[/color]
    [color=#0000ff]type[/color]
    DATA [color=#000000]=[/color] [color=#0000ff]record[/color]
    diaadesao [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    mesadesao [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    anoadesao [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    dianascimento [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    mesnascimento [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    anonascimento [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]

    [color=#008000]{Criando registro do tipo cliente}[/color]
    [color=#008000]{type}[/color] [color=#008000]//para que outro type[/color]
    cliente [color=#000000]=[/color] [color=#0000ff]record[/color]
    nome [color=#000000]:[/color][color=#0000ff]string[/color][color=#000000];[/color]
    sexo [color=#000000]:[/color][color=#0000ff]string[/color][color=#000000];[/color]
    cpf [color=#000000]:[/color][color=#0000ff]string[/color][color=#000000];[/color]
    data [color=#000000]:[/color]DATA[color=#000000];[/color]
    plano [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    valor [color=#000000]:[/color][color=#0000ff]real[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#008000]{type}[/color] [color=#008000]//para que outro type[/color]
    arquivo [color=#000000]=[/color] [color=#0000ff]file of[/color] cliente[color=#000000];[/color]

    [color=#008000]{Procedimento para criar um arquivo}[/color]
    [color=#0000ff]procedure[/color] [color=#000000]novo_arquivo[/color][color=#000000]([/color][color=#0000ff]var[/color] arq[color=#000000]:[/color]arquivo[color=#000000]);[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]Assign[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#a31515]'PROGRAMAÇAO 1A.arq'[/color][color=#000000]);[/color]
    [color=#008000]{$I-}[/color]
    [color=#000000]reset[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#008000]//{SI+} //como já comentei, o correto é $[/color]
    [color=#008000]{$I+}[/color]
    [color=#2b91af]if[/color] IOResult [color=#000000]=[/color] [color=#000000]0[/color] [color=#2b91af]then[/color]
    [color=#000000]seek[/color][color=#000000]([/color]arq[color=#000000],[/color] [color=#000000]filesize[/color][color=#000000]([/color]arq[color=#000000]))[/color]
    [color=#2b91af]else[/color]
    [color=#000000]rewrite[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]

    [color=#008000]{Função para criar o menu}[/color]
    [color=#0000ff]function[/color] [color=#000000]menu[/color][color=#000000]():[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    [color=#0000ff]var[/color]
    op [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    [color=#0000ff]begin[/color]
    op [color=#000000]:=[/color][color=#000000]0[/color][color=#000000];[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'--------------------------------'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Entre com a opcao: '[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'1-Cadastrar cliente'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'2-Consultar dados de um cliente'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'3-Excluir um cliente'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'4-Calculo da contribuicao mensal de um cliente'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'5-Calculo do acumulo da contribuicao de um cliente'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'6-Ver o acumulo de caixa da empresa'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'7-Ver maior contribuinte da empresa'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'8-Ver a media das contribuicoes dos clientes'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'9-Retornar clientes com contribuicao acima da media'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'10-Relatorio de clientes'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'11-Sair'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]readln[/color][color=#000000]([/color]op[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'--------------------------------'[/color][color=#000000]);[/color]
    menu [color=#000000]:=[/color]op[color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]

    [color=#0000ff]procedure[/color] [color=#000000]cadastrar_cliente[/color] [color=#000000]([/color][color=#0000ff]var[/color] arq[color=#000000]:[/color]arquivo[color=#000000]);[/color][color=#008000]{Procedimento que cadastra os clientes}[/color]
    [color=#0000ff]var[/color]
    c [color=#000000]:[/color]cliente[color=#000000];[/color]
    plano[color=#000000],[/color]
    dia1[color=#000000],[/color]
    dia2[color=#000000],[/color]
    mes1[color=#000000],[/color]
    mes2[color=#000000],[/color]
    ano1[color=#000000],[/color]
    ano2 [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    valor [color=#000000]:[/color][color=#0000ff]real[/color][color=#000000];[/color]
    nome[color=#000000],[/color]
    cpf[color=#000000],[/color] sexo[color=#000000]:[/color][color=#0000ff]string[/color][color=#000000];[/color]
    achei [color=#000000]:[/color][color=#0000ff]boolean[/color][color=#000000];[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Entre com o CPF do cliente: '[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]readln[/color][color=#000000]([/color]cpf[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Digite o sexo do cliente(M/F): '[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]readln[/color][color=#000000]([/color]sexo[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Digite o nome do cliente: '[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]readln[/color][color=#000000]([/color]nome[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Dia, mes e ano do nascimento do cliente: '[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]readln[/color][color=#000000]([/color]dia1[color=#000000],[/color]mes1[color=#000000],[/color]ano1[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Digite o tipo de plano escolhido pelo cliente: '[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]readln[/color][color=#000000]([/color]plano[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Valor inicial: '[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]readln[/color][color=#000000]([/color]valor[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Dia, mes e ano da adesao do plano: '[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]readln[/color][color=#000000]([/color]dia2[color=#000000],[/color]mes2[color=#000000],[/color]ano2[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    achei [color=#000000]:=[/color][color=#0000ff]false[/color][color=#000000];[/color]
    [color=#000000]seek[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#000000]0[/color][color=#000000]);[/color]
    [color=#2b91af]while[/color] [color=#000000](([/color][color=#0000ff]not[/color] [color=#000000]eof[/color][color=#000000]([/color]arq[color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000]([/color][color=#0000ff]not[/color] achei[color=#000000]))[/color] [color=#2b91af]do[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]read[/color][color=#000000]([/color]arq[color=#000000],[/color]c[color=#000000]);[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]c[color=#000000].[/color]cpf [color=#000000]=[/color] cpf[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    achei [color=#000000]:=[/color] [color=#0000ff]true[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color][color=#0000ff]not[/color] achei[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]seek[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#000000]filesize[/color][color=#000000]([/color]arq[color=#000000]));[/color]
    c[color=#000000].[/color]cpf[color=#000000]:=[/color]cpf[color=#000000];[/color]
    c[color=#000000].[/color]sexo[color=#000000]:=[/color]sexo[color=#000000];[/color]
    c[color=#000000].[/color]nome[color=#000000]:=[/color]nome[color=#000000];[/color]
    c[color=#000000].[/color]plano[color=#000000]:=[/color]plano[color=#000000];[/color]
    c[color=#000000].[/color]valor[color=#000000]:=[/color]valor[color=#000000];[/color]
    c[color=#000000].[/color]data[color=#000000].[/color]dianascimento[color=#000000]:=[/color]dia1[color=#000000];[/color]
    c[color=#000000].[/color]data[color=#000000].[/color]mesnascimento[color=#000000]:=[/color]mes1[color=#000000];[/color]
    c[color=#000000].[/color]data[color=#000000].[/color]anonascimento[color=#000000]:=[/color]ano1[color=#000000];[/color]
    c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000]:=[/color]dia2[color=#000000];[/color]
    c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000]:=[/color]mes2[color=#000000];[/color]
    c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000]:=[/color]ano2[color=#000000];[/color]
    [color=#008000]//{S-} //como já comentei, o correto é $[/color]
    [color=#008000]{$I-}[/color]
    [color=#000000]write[/color][color=#000000]([/color]arq[color=#000000],[/color]c[color=#000000]);[/color]
    [color=#008000]//{S+} //como já comentei, o correto é $[/color]
    [color=#008000]{$I+}[/color]
    [color=#2b91af]if[/color] IOResult [color=#000000]=[/color] [color=#000000]0[/color] [color=#2b91af]then[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Cliente cadastrado com sucesso'[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color]
    [color=#2b91af]else[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Ja existe um cliente com esse CPF'[/color][color=#000000]);[/color]
    [color=#008000]//writeln('Cliente: ',+c.nome); //basta a vírgula, o "+" não entre nesse caso[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Cliente: '[/color][color=#000000],[/color]c[color=#000000].[/color]nome[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]

    [color=#008000]{Procedimento que consulta os clientes}[/color]
    [color=#0000ff]procedure[/color] [color=#000000]consultar_cliente[/color][color=#000000]([/color][color=#0000ff]var[/color] arq[color=#000000]:[/color]arquivo[color=#000000]);[/color]
    [color=#0000ff]var[/color]
    c [color=#000000]:[/color]cliente[color=#000000];[/color]
    cpf [color=#000000]:[/color][color=#0000ff]string[/color][color=#000000];[/color]
    achei [color=#000000]:[/color][color=#0000ff]boolean[/color][color=#000000];[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Digite o CPF do cliente: '[/color][color=#000000]);[/color]
    [color=#000000]readln[/color][color=#000000]([/color]cpf[color=#000000]);[/color]
    [color=#000000]seek[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#000000]0[/color][color=#000000]);[/color]
    achei[color=#000000]:=[/color][color=#0000ff]false[/color][color=#000000];[/color]
    [color=#2b91af]while[/color] [color=#000000](([/color][color=#0000ff]not[/color] [color=#000000]eof[/color][color=#000000]([/color]arq[color=#000000]))[/color][color=#0000ff]and[/color] [color=#000000]([/color][color=#0000ff]not[/color] achei[color=#000000]))[/color] [color=#2b91af]do[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]read[/color][color=#000000]([/color]arq[color=#000000],[/color]c[color=#000000]);[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]c[color=#000000].[/color]cpf [color=#000000]=[/color] cpf[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    achei [color=#000000]:=[/color][color=#0000ff]true[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]achei[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'--------------------------------'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Nome do cliente: '[/color][color=#000000],[/color]c[color=#000000].[/color]nome[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Sexo do cliente: '[/color][color=#000000],[/color]c[color=#000000].[/color]sexo[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Cpf do cliente:'[/color][color=#000000],[/color]c[color=#000000].[/color]cpf[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Data de nascimento: '[/color][color=#000000],[/color]c[color=#000000].[/color]data[color=#000000].[/color]dianascimento[color=#000000],[/color][color=#a31515]'/'[/color][color=#000000],[/color]c[color=#000000].[/color]data[color=#000000].[/color]mesnascimento[color=#000000],[/color][color=#a31515]'/'[/color][color=#000000],[/color]c[color=#000000].[/color]data[color=#000000].[/color]anonascimento[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Data de adesao do plano: '[/color][color=#000000],[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000],[/color][color=#a31515]'/'[/color][color=#000000],[/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000],[/color][color=#a31515]'/'[/color][color=#000000],[/color]c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Tipo de plano escolhido: '[/color][color=#000000],[/color]c[color=#000000].[/color]plano[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]();[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Contribuicao inicial: '[/color][color=#000000],[/color]c[color=#000000].[/color]valor[color=#000000]:[/color][color=#000000]4[/color][color=#000000]:[/color][color=#000000]2[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color]
    [color=#2b91af]else[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'--------------------------------'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Nao existe cliente com este cpf'[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]

    [color=#008000]{Procedimento que apaga o cadastro de um cliente}[/color]
    [color=#0000ff]procedure[/color] [color=#000000]apagar_cadastro[/color][color=#000000]([/color][color=#0000ff]var[/color] arq[color=#000000]:[/color]arquivo[color=#000000]);[/color]
    [color=#0000ff]var[/color]
    arq2 [color=#000000]:[/color]arquivo[color=#000000];[/color]
    achou [color=#000000]:[/color][color=#0000ff]boolean[/color][color=#000000];[/color]
    c [color=#000000]:[/color]cliente[color=#000000];[/color]
    cpf [color=#000000]:[/color][color=#0000ff]string[/color][color=#000000];[/color]
    escolha [color=#000000]:[/color][color=#0000ff]string[/color][color=#000000];[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]write[/color][color=#000000]([/color][color=#a31515]'Digite o CPF do cliente a ser excluido: '[/color][color=#000000]);[/color]
    [color=#000000]readln[/color][color=#000000]([/color]cpf[color=#000000]);[/color]
    [color=#000000]Assign[/color][color=#000000]([/color]arq2[color=#000000],[/color][color=#a31515]'Arquivo2.arq'[/color][color=#000000]);[/color]
    [color=#000000]rewrite[/color][color=#000000]([/color]arq2[color=#000000]);[/color]
    achou[color=#000000]:=[/color] [color=#0000ff]false[/color][color=#000000];[/color]
    [color=#000000]seek[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#000000]0[/color][color=#000000]);[/color]
    [color=#2b91af]while[/color] [color=#000000]([/color][color=#0000ff]not[/color] [color=#000000]eof[/color][color=#000000]([/color]arq[color=#000000]))[/color] [color=#2b91af]do[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]read[/color][color=#000000]([/color]arq[color=#000000],[/color]c[color=#000000]);[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]c[color=#000000].[/color]cpf [color=#000000]<>[/color] cpf[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#000000]write[/color][color=#000000]([/color]arq2[color=#000000],[/color]c[color=#000000])[/color]
    [color=#2b91af]else[/color]
    [color=#0000ff]begin[/color]
    achou [color=#000000]:=[/color][color=#0000ff]true[/color][color=#000000];[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Nome do cliente '[/color][color=#000000],[/color]c[color=#000000].[/color]nome[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Deseja excluir esse cliente? (S/N)'[/color][color=#000000]);[/color]
    [color=#000000]readln[/color][color=#000000]([/color]escolha[color=#000000]);[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]escolha [color=#000000]=[/color] [color=#a31515]'S'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]escolha [color=#000000]=[/color] [color=#a31515]'s'[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'O cliente foi excluido com sucesso'[/color][color=#000000])[/color]
    [color=#2b91af]else[/color]
    [color=#000000]write[/color][color=#000000]([/color]arq2[color=#000000],[/color]c[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color][color=#0000ff]not[/color] achou[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'------------------------------'[/color][color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'CPF nao encontrado'[/color][color=#000000]);[/color]
    [color=#000000]close[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#000000]erase[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#000000]close[/color][color=#000000]([/color]arq2[color=#000000]);[/color]
    [color=#000000]rename[/color][color=#000000]([/color]arq2[color=#000000],[/color][color=#a31515]'PROGRAMAÇAO 1A.arq'[/color][color=#000000]);[/color]
    [color=#000000]novo_arquivo[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]

    [color=#008000]{Função que retorna o valor da contribuição em determinado mês de um cliente}[/color]
    [color=#0000ff]function[/color] [color=#000000]contribuicao_mensal[/color][color=#000000]([/color]c[color=#000000]:[/color]cliente[color=#000000]):[/color][color=#0000ff]real[/color][color=#000000];[/color]
    [color=#0000ff]var[/color]
    i[color=#000000],[/color]
    diadito[color=#000000],[/color]
    mesdito[color=#000000],[/color]
    anodito[color=#000000],[/color]
    qtdeanos[color=#000000],[/color]
    qtdemeses [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    valortotal[color=#000000],[/color]
    valorparcial [color=#000000]:[/color][color=#0000ff]real[/color][color=#000000];[/color]
    achei [color=#000000]:[/color][color=#0000ff]boolean[/color][color=#000000];[/color]
    arq [color=#000000]:[/color]arquivo[color=#000000];[/color]
    cpf [color=#000000]:[/color][color=#0000ff]string[/color][color=#000000];[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Digite o cpf do cliente: '[/color][color=#000000]);[/color]
    [color=#000000]readln[/color][color=#000000]([/color]cpf[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Digite uma dia, mes e ano: '[/color][color=#000000]);[/color]
    [color=#000000]readln[/color][color=#000000]([/color]diadito[color=#000000],[/color]mesdito[color=#000000],[/color]anodito[color=#000000]);[/color]
    [color=#000000]Assign[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#a31515]'PROGRAMAÇAO 1A.arq'[/color][color=#000000]);[/color]
    [color=#000000]reset[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#000000]seek[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#000000]0[/color][color=#000000]);[/color]
    achei[color=#000000]:=[/color][color=#0000ff]false[/color][color=#000000];[/color]
    [color=#2b91af]while[/color] [color=#000000](([/color][color=#0000ff]not[/color] [color=#000000]eof[/color][color=#000000]([/color]arq[color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000]([/color][color=#0000ff]not[/color] achei[color=#000000]))[/color] [color=#2b91af]do[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]read[/color][color=#000000]([/color]arq[color=#000000],[/color]c[color=#000000]);[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]c[color=#000000].[/color]cpf [color=#000000]=[/color] cpf[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    achei[color=#000000]:=[/color][color=#0000ff]true[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]achei[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesdito[color=#000000]>[/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diadito[color=#000000]>=[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anodito [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000];[/color]
    qtdemeses[color=#000000]:=([/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000])+ ([/color]mesdito [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesdito[color=#000000]>[/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diadito[color=#000000]<[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anodito [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao [color=#000000];[/color]
    qtdemeses[color=#000000]:=([/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000])+([/color]mesdito [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]mesadesao [color=#000000]-[/color] [color=#000000]1[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesdito [color=#000000]=[/color] c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diadito[color=#000000]<[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anodito [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000];[/color]
    qtdemeses[color=#000000]:=([/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000]) -[/color] [color=#000000]1[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesdito [color=#000000]=[/color] c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diadito[color=#000000]>=[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anodito [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000];[/color]
    qtdemeses[color=#000000]:=[/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesdito[color=#000000]<[/color] c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diadito[color=#000000]<[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anodito [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000];[/color]
    qtdemeses[color=#000000]:=([/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000])-([/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao [color=#000000]-[/color] mesdito [color=#000000]+[/color][color=#000000]1[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesdito[color=#000000]<[/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diadito[color=#000000]>=[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anodito [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000];[/color]
    qtdemeses[color=#000000]:=([/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000])-([/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao [color=#000000]-[/color] mesdito[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'M'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'m'[/color][color=#000000]))[/color][color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]1[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]qtdeanos[color=#000000]<=[/color][color=#000000]65[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    i[color=#000000]:=[/color][color=#000000]1[/color][color=#000000];[/color]
    valortotal[color=#000000]:=[/color]c[color=#000000].[/color]valor[color=#000000];[/color]
    [color=#2b91af]while[/color] [color=#000000]([/color]i[color=#000000]<=[/color]qtdemeses[color=#000000])[/color] [color=#2b91af]do[/color]
    [color=#0000ff]begin[/color]
    valorparcial[color=#000000]:=([/color]valortotal[color=#000000]*[/color][color=#000000]0.03[/color][color=#000000])/[/color][color=#000000]100[/color][color=#000000];[/color]
    valortotal[color=#000000]:=[/color]valortotal[color=#000000]+[/color]valorparcial[color=#000000];[/color]
    i[color=#000000]:=[/color]i[color=#000000]+[/color][color=#000000]1[/color][color=#000000];;[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    contribuicao_mensal[color=#000000]:=[/color]valortotal[color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'M'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'m'[/color][color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]1[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]qtdeanos[color=#000000]>[/color][color=#000000]65[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'O cliente'[/color][color=#000000],[/color]c[color=#000000].[/color]nome[color=#000000],[/color][color=#a31515]' ja nao contribui mais nessa data'[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'M'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'m'[/color][color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]2[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]qtdeanos[color=#000000]<=[/color][color=#000000]65[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    valortotal[color=#000000]:=[/color]c[color=#000000].[/color]valor
    [color=#0000ff]end[/color][color=#000000];[/color]
    contribuicao_mensal[color=#000000]:=[/color]valortotal[color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'M'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'m'[/color][color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]2[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]qtdeanos[color=#000000]>[/color][color=#000000]65[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'O cliente'[/color][color=#000000],[/color]c[color=#000000].[/color]nome[color=#000000],[/color][color=#a31515]' ja nao contribui mais nessa data'[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'M'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'m'[/color][color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]1[/color][color=#000000])[/color] [color=#0000ff]and[/color][color=#000000]([/color]qtdeanos[color=#000000]<=[/color][color=#000000]60[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    i[color=#000000]:=[/color][color=#000000]1[/color][color=#000000];[/color]
    valortotal[color=#000000]:=[/color]c[color=#000000].[/color]valor[color=#000000];[/color]
    [color=#2b91af]while[/color][color=#000000]([/color]i[color=#000000]<=[/color]qtdemeses[color=#000000])[/color] [color=#2b91af]do[/color]
    [color=#0000ff]begin[/color]
    valorparcial[color=#000000]:=([/color]valortotal[color=#000000]*[/color][color=#000000]0.03[/color][color=#000000])/[/color][color=#000000]100[/color][color=#000000];[/color]
    valortotal[color=#000000]:=[/color]valortotal[color=#000000]+[/color]valorparcial[color=#000000];[/color]
    i[color=#000000]:=[/color]i[color=#000000]+[/color][color=#000000]1[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    contribuicao_mensal[color=#000000]:=[/color]valortotal[color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'F'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'f'[/color][color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]1[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]qtdeanos[color=#000000]>[/color][color=#000000]60[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'A cliente'[/color][color=#000000],[/color]c[color=#000000].[/color]nome[color=#000000],[/color][color=#a31515]'ja nao contribui mais nessa data'[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'F'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'f'[/color][color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]2[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]qtdeanos[color=#000000]<=[/color][color=#000000]60[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    valortotal[color=#000000]:=[/color]c[color=#000000].[/color]valor[color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    contribuicao_mensal[color=#000000]:=[/color]valortotal[color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'F'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'f'[/color][color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]2[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]qtdeanos[color=#000000]>[/color][color=#000000]60[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'A cliente'[/color][color=#000000],[/color]c[color=#000000].[/color]nome[color=#000000],[/color][color=#a31515]'ja nao contribui mais nessa data'[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color]
    [color=#2b91af]else[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'CPF nao encontrado'[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color] [color=#008000]{ESTAVA FALTANDO ESSE END}[/color]

    [color=#008000]{Função que retorna o total acumulado pago pelo cliente}[/color]
    [color=#0000ff]function[/color] [color=#000000]acumulo_contribuicao[/color][color=#000000]([/color]c[color=#000000]:[/color]cliente[color=#000000]):[/color][color=#0000ff]real[/color][color=#000000];[/color]
    [color=#0000ff]var[/color]
    i[color=#000000],[/color]
    qtdeanos[color=#000000],[/color]
    qtdemeses[color=#000000],[/color]
    diaX[color=#000000],[/color]
    mesX[color=#000000],[/color]
    anoX [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    valorqualquer[color=#000000],[/color]
    valortotal[color=#000000],[/color]
    valorparcial [color=#000000]:[/color][color=#0000ff]real[/color][color=#000000];[/color]
    achei [color=#000000]:[/color][color=#0000ff]boolean[/color][color=#000000];[/color]
    arq [color=#000000]:[/color]arquivo[color=#000000];[/color]
    cpf [color=#000000]:[/color][color=#0000ff]string[/color][color=#000000];[/color]

    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Digite o CPF do cliente: '[/color][color=#000000]);[/color]
    [color=#000000]readln[/color][color=#000000]([/color]cpf[color=#000000]);[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Digite um dia, mes e ano: '[/color][color=#000000]);[/color]
    [color=#000000]readln[/color][color=#000000]([/color]diax[color=#000000],[/color]mesx[color=#000000],[/color]anox[color=#000000]);[/color]
    [color=#000000]Assign[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#a31515]'PROGRAMAÇAO 1A.arq'[/color][color=#000000]);[/color]
    [color=#000000]reset[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#000000]seek[/color][color=#000000]([/color]arq[color=#000000],[/color][color=#000000]0[/color][color=#000000]);[/color]
    achei[color=#000000]:=[/color][color=#0000ff]false[/color][color=#000000];[/color]
    [color=#2b91af]while[/color] [color=#000000]([/color][color=#0000ff]not[/color] [color=#000000]eof[/color] [color=#000000]([/color]arq[color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000]([/color][color=#0000ff]not[/color] achei[color=#000000])[/color] [color=#2b91af]do[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]read[/color][color=#000000]([/color]arq[color=#000000],[/color]c[color=#000000]);[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]c[color=#000000].[/color]cpf [color=#000000]=[/color] cpf[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    achei[color=#000000]:=[/color][color=#0000ff]true[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]achei[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesX[color=#000000]>[/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diaX[color=#000000]>=[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anoX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000];[/color]
    qtdemeses[color=#000000]:=([/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000])+([/color]mesX[color=#000000]-[/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#008000]{if ((mesX>c.data.mesadesao) and (diaX<c.data.diaadesao) then}[/color] [color=#008000]//AQUI FALTOU UM ")"[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]mesX[color=#000000]>[/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diaX[color=#000000]<[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000]))[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anoX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao [color=#000000];[/color]
    qtdemeses[color=#000000]:=([/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000])+([/color]mesX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]mesadesao [color=#000000]-[/color] [color=#000000]1[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesX [color=#000000]=[/color] c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diaX[color=#000000]<[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anoX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000];[/color]
    qtdemeses[color=#000000]:=([/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000]) -[/color] [color=#000000]1[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesX [color=#000000]=[/color] c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diaX[color=#000000]>=[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anoX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000];[/color]
    qtdemeses[color=#000000]:=[/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesX[color=#000000]<[/color] c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diaX[color=#000000]<[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#008000]{qtdeanos:=anoX - c.data.anoaadesao;}[/color] [color=#008000]//tem um "a" a mais[/color]
    qtdeanos[color=#000000]:=[/color]anoX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoAdesao[color=#000000];[/color]
    qtdemeses[color=#000000]:=([/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000])-([/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao [color=#000000]-[/color] mesX [color=#000000]+[/color][color=#000000]1[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]mesX[color=#000000]<[/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao[color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]diaX[color=#000000]>=[/color]c[color=#000000].[/color]data[color=#000000].[/color]diaadesao[color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    qtdeanos[color=#000000]:=[/color]anoX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anoadesao[color=#000000];[/color]
    qtdemeses[color=#000000]:=([/color]qtdeanos[color=#000000]*[/color][color=#000000]12[/color][color=#000000])-([/color]c[color=#000000].[/color]data[color=#000000].[/color]mesadesao [color=#000000]-[/color] mesX[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'M'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'m'[/color][color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000](([/color]anoX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anonascimento[color=#000000])<=[/color][color=#000000]65[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]1[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    i[color=#000000]:=[/color][color=#000000]1[/color][color=#000000];[/color]
    valorqualquer[color=#000000]:=[/color]c[color=#000000].[/color]valor[color=#000000];[/color]
    valortotal[color=#000000]:=[/color][color=#000000]0[/color][color=#000000];[/color]
    [color=#2b91af]while[/color][color=#000000]([/color]i[color=#000000]<=[/color]qtdemeses[color=#000000])[/color] [color=#2b91af]do[/color]
    [color=#0000ff]begin[/color]
    valorparcial[color=#000000]:=(([/color]valorqualquer[color=#000000]*[/color][color=#000000]0.03[/color][color=#000000])/[/color][color=#000000]100[/color][color=#000000]);[/color]
    valorqualquer[color=#000000]:=[/color]valorqualquer[color=#000000]+[/color]valorparcial[color=#000000];[/color]
    valortotal[color=#000000]:=[/color]valortotal[color=#000000]+[/color]valorqualquer[color=#000000];[/color]
    i[color=#000000]:=[/color]i[color=#000000]+[/color][color=#000000]1[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    acumulo_contribuicao[color=#000000]:=[/color]valortotal[color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'M'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'m'[/color][color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000](([/color]anoX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anonascimento[color=#000000])<=[/color][color=#000000]65[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]2[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    valortotal[color=#000000]:=[/color]qtdemeses[color=#000000]*[/color]c[color=#000000].[/color]valor[color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    acumulo_contribuicao[color=#000000]:=[/color]valortotal[color=#000000];[/color]
    [color=#2b91af]if[/color][color=#000000](([/color]c[color=#000000].[/color]sexo [color=#000000]=[/color][color=#a31515]'F'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'f'[/color][color=#000000]))[/color] [color=#0000ff]and[/color][color=#000000](([/color]anoX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anonascimento[color=#000000])<=[/color][color=#000000]60[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]1[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    i[color=#000000]:=[/color][color=#000000]1[/color][color=#000000];[/color]
    valorqualquer[color=#000000]:=[/color]c[color=#000000].[/color]valor[color=#000000];[/color]
    valortotal[color=#000000]:=[/color][color=#000000]0[/color][color=#000000];[/color]
    [color=#2b91af]while[/color][color=#000000]([/color]i[color=#000000]<=[/color]qtdemeses[color=#000000])[/color] [color=#2b91af]do[/color]
    [color=#0000ff]begin[/color]
    valorparcial[color=#000000]:=(([/color]valorqualquer[color=#000000]*[/color][color=#000000]0.03[/color][color=#000000])/[/color][color=#000000]100[/color][color=#000000]);[/color]
    valorqualquer[color=#000000]:=[/color]valorqualquer[color=#000000]+[/color]valorparcial[color=#000000];[/color]
    valortotal[color=#000000]:=[/color]valortotal[color=#000000]+[/color]valorqualquer[color=#000000];[/color]
    i[color=#000000]:=[/color]i[color=#000000]+[/color][color=#000000]1[/color][color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    acumulo_contribuicao[color=#000000]:=[/color]valortotal[color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000](([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'F'[/color][color=#000000])[/color] [color=#0000ff]or[/color] [color=#000000]([/color]c[color=#000000].[/color]sexo[color=#000000]=[/color][color=#a31515]'f'[/color][color=#000000]))[/color] [color=#0000ff]and[/color] [color=#000000](([/color]anoX [color=#000000]-[/color] c[color=#000000].[/color]data[color=#000000].[/color]anonascimento[color=#000000])<=[/color][color=#000000]60[/color][color=#000000])[/color] [color=#0000ff]and[/color] [color=#000000]([/color]c[color=#000000].[/color]plano[color=#000000]=[/color][color=#000000]2[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    valortotal[color=#000000]:=[/color]qtdemeses[color=#000000]*[/color]c[color=#000000].[/color]valor[color=#000000];[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    acumulo_contribuicao[color=#000000]:=[/color]valortotal[color=#000000];[/color]
    [color=#0000ff]end[/color]
    [color=#2b91af]else[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'CPF nao encontrado'[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]

    [color=#008000]{Procedimento que fecha o arquivo}[/color]
    [color=#0000ff]procedure[/color] [color=#000000]fecha_arquivo[/color][color=#000000]([/color][color=#0000ff]var[/color] arq[color=#000000]:[/color]arquivo[color=#000000]);[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]close[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]

    [color=#008000]{Variáveis do programa principal}[/color]
    [color=#0000ff]var[/color]
    arq [color=#000000]:[/color]arquivo[color=#000000];[/color]
    op [color=#000000]:[/color][color=#0000ff]integer[/color][color=#000000];[/color]
    c [color=#000000]:[/color]cliente[color=#000000];[/color]

    [color=#008000](*[/color]
    [color=#008000]INICIO DO PROGRAMA PRICIPAL[/color]
    [color=#008000]*)[/color]
    [color=#0000ff]BEGIN[/color]
    [color=#000000]novo_arquivo[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    op [color=#000000]:=[/color] [color=#000000]0[/color][color=#000000];[/color]
    [color=#2b91af]repeat[/color]
    op [color=#000000]:=[/color] [color=#000000]menu[/color][color=#000000]();[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]op [color=#000000]=[/color] [color=#000000]1[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]cadastrar_cliente[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]op [color=#000000]=[/color] [color=#000000]2[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]consultar_cliente[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]op [color=#000000]=[/color] [color=#000000]3[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]apagar_cadastro[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]op [color=#000000]=[/color] [color=#000000]4[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#000000]contribuicao_mensal[/color][color=#000000]([/color]c[color=#000000]));[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Contribuicao mensal: '[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]if[/color] [color=#000000]([/color]op [color=#000000]=[/color] [color=#000000]5[/color][color=#000000])[/color] [color=#2b91af]then[/color]
    [color=#0000ff]begin[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#000000]acumulo_contribuicao[/color][color=#000000]([/color]c[color=#000000]));[/color]
    [color=#000000]writeln[/color][color=#000000]([/color][color=#a31515]'Acumulo de contribuicao: '[/color][color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000];[/color]
    [color=#2b91af]until[/color] op [color=#000000]=[/color] [color=#000000]11[/color][color=#000000];[/color]
    [color=#000000]fecha_arquivo[/color][color=#000000]([/color]arq[color=#000000]);[/color]
    [color=#0000ff]end[/color][color=#000000].[/color]
    [color=#0000ff]PROGRAM[/color] trabalho[color=#000000];[/color]

    No aguardo

    Abraços

    Compartilhar este post


    Link para o post
    Compartilhar em outros sites
    Cara, eu acho que consegui... em vez de fazer funções, fiz tudo procedimento..

    da uma olhada ai..

    http://pastebin.com/9sKhLpKR

    Olá,

    Seu código não está compilando. Como já fiz alguns comentários anteriormente, não vou comentar novamente sobre os erros... ^_^

    Qualquer coisa comece a fazer as alterações a partir do código que postei anteriormente.

    No aguardo

    Abraços

    Compartilhar este post


    Link para o post
    Compartilhar em outros sites
  • Autor do tópico
  • Desculpa tanto tempo assim pra responder.. ahah

    consegui fazer .. depois de dias e dias..

    tirei 9 no trabalho e consequentemente passei..

    obrigado pelas ajudas.

    abraço

    Compartilhar este post


    Link para o post
    Compartilhar em outros sites

    Crie uma conta ou entre para comentar

    Você precisar ser um membro para fazer um comentário






    Sobre o Clube do Hardware

    No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas publicações sobre tecnologia do Brasil. Leia mais

    Direitos autorais

    Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

    ×