Advertisement
henriqueforino

Lista1_Ex2

Dec 11th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.89 KB | None | 0 0
  1. // Aluno: Luiz Henrique Forino
  2. // Programação 1, professor Thiago PX
  3.  
  4. program L1_Q2;
  5. uses crt;
  6.  
  7. const
  8.     horatrab = 10; //Hora trabalhada
  9.     horaexce = 20; //Hora excedente
  10.     hrexc = 50; // Hora excedente a 50
  11. var
  12.     cpf : string;
  13.     numhortrab  : integer; //número de horas trabalhadas
  14.     salariototal : integer;
  15.     salarioexcedente : integer;
  16.  
  17. begin
  18.     textbackground (white);
  19.         textcolor (blue);
  20.         clrscr;
  21.  
  22.     writeln ('Digite seu CPF: ');
  23.     readln (cpf);
  24.     writeln ('Digite o total de horas trabalhadas;  ');
  25.     readln (numhortrab);
  26.    
  27.     if numhortrab <= hrexc then
  28.      begin
  29.         salariototal := numhortrab * horatrab;
  30.         salarioexcedente :=0
  31.      end   
  32.    
  33.     else
  34.      begin
  35.         salarioexcedente:= (numhortrab-hrexc)* horaexce;
  36.         salariototal:= salarioexcedente + (hrexc*10);
  37.      end;    
  38.     writeln ('Salário total: ', salariototal, '    Salário excedente: ', salarioexcedente) ;
  39.     readkey;
  40. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement