Jump to content

programa (case of)


vascoprogramador
 Share

Recommended Posts

Pessoal preciso de ajuda urgente para fazer 1 programa que leia o ordenado de 1 funcionario e o nº de horas que este trabalhou e que calcule o vencimento!!

PROGRAM HorasExtra(INPUT,OUTPUT);

VAR horas:INTEGER;

    venc,quantia:REAL;

BEGIN

     REPEAT

           WRITE('Qual o vencimento base do funcion rio ? ');

           READLN(venc)

     UNTIL venc>=0;

     REPEAT

           WRITE('Quantas horas extra fez o funcion rio ? ');

           READLN(horas)

     UNTIL horas>0;

     CASE horas OF

          1..10:quantia:=(venc*(1/50))*horas;

         11..20:quantia:=(venc*(1/45))*horas;

         21..30:quantia:=(venc*(1/35))*horas;

         31..40:quantia:=(venc*(1/25))*horas

         ELSE quantia:=(venc*(1/10))*horas

     END;

     WRITELN('O vencimento total ‚ ',venc+quantia:8:4)

END.

Link to comment
Share on other sites

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
 Share

×
×
  • 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.