Ir para conteúdo
Fórum Script Brasil

Alexandreuser

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Sobre Alexandreuser

Alexandreuser's Achievements

0

Reputação

  1. preciso de ajuda no seguinte algoritmo: O filme Alice no país das maravilhas está fazendo uma enquete para saber o que o público achou do filme, será necessário desenvolver um programa que tenha 5 opções (excelente, ótimo, bom, regular, ruim), e deverá informar a idade. % de excelente % de ótimo % de bom % de regular % de ruim Faixa etária: crianças: 5 á 12 anos adolescente: 13 á 17 anos adulto: 18 á 50 anos O meu algoritmo ficou assim: Program ex3l2; var op,ex,ot,bom,reg,ru,id:integer; Begin writeln('10 - excelente'); writeln('8 - ótimo'); writeln('5 - bom'); writeln('3 - regular'); writeln('1 - ruim'); writeln('informe nota'); readln(op); while op <> 0 do begin writeln('informe idade'); readln(id); writeln('informe nota'); readln(op); if op=10 then ex:=ex+1; if (id>=5) and (id<=12) or (id>=13) and (id<=17) or (id>=18) and (id<=50) then id:=id else if op=8 then ot:=ot+1; if (id>=5) and (id<=12) or (id>=13) and (id<=17) or (id>=18) and (id<=50) then id:=id else if op=5 then bom:=bom+1; if (id>=5) and (id<=12) or (id>=13) and (id<=17) or (id>=18) and (id<=50) then id:=id else if op=3 then reg:=reg+1; if (id>=5) and (id<=12) or (id>=13) and (id<=17) or (id>=18) and (id<=50) then id:=id else if op=1 then ru:=ru+1; if (id>=5) and (id<=12) or (id>=13) and (id<=17) or (id>=18) and (id<=50) then id:=id end; writeln(ex,'% de excelente, idade:',id); writeln(ot,id,'% de ótimo, idade:',id); writeln(bom,id,'% de bom, idade:',id); writeln(reg,id,'% de regular, idade:',id); writeln(ru,id,'% de ruim, idade:',id); End. mas Não dá certo, ajuda aí
×
×
  • Criar Novo...