Advertisement
Jvsierra

EX 5 EXTRAS

Mar 2nd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. int main(){
  5.   int idade, ano_cont, mat, anos_emp, ano_atual;
  6.   char sexo;
  7.   float sal_base, reajuste, acrescimo, novo_sal, total_acrescimos;
  8.  
  9.   printf("Digite os dados: \n");
  10.   scanf("%d %c %f %d %d %d", &idade, &sexo, &sal_base, &ano_cont, &mat, &ano_atual);
  11.  
  12.   anos_emp = ano_atual - ano_cont;
  13.  
  14.   if(idade >= 18 && idade <= 39){
  15.     if(sexo == 'M'){
  16.         reajuste = sal_base * 10/100;
  17.        
  18.         if(anos_emp <= 10)
  19.             acrescimo = -10;
  20.         else
  21.             acrescimo = 17;
  22.       }else{
  23.         reajuste = sal_base * 8/100;
  24.        
  25.         if(anos_emp <= 10)
  26.             acrescimo = -11;
  27.         else
  28.             acrescimo = 16;
  29.       }
  30.   }else if(idade >= 40 && idade <= 69){
  31.       if(sexo == 'M'){
  32.         reajuste = sal_base * 8/100;
  33.        
  34.         if(anos_emp <= 10)
  35.             acrescimo = -5;
  36.         else
  37.             acrescimo = 15;
  38.       }else{
  39.         reajuste = sal_base * 10/100;
  40.        
  41.         if(anos_emp <= 10)
  42.             acrescimo = -7;
  43.         else
  44.             acrescimo = 14;
  45.       }
  46.   }else if(idade >= 70 && idade <= 99){
  47.     if(sexo == 'M'){
  48.         reajuste = sal_base * 15/100;
  49.        
  50.         if(anos_emp <= 10)
  51.             acrescimo = -15;
  52.         else
  53.             acrescimo = 13;
  54.       }else{
  55.         reajuste = sal_base * 17/100;
  56.        
  57.         if(anos_emp <= 10)
  58.             acrescimo = -17;
  59.         else
  60.             acrescimo = 12;
  61.       }
  62.   }
  63.  
  64.   total_acrescimos = reajuste + acrescimo;
  65.  
  66.   novo_sal = sal_base + total_acrescimos;
  67.  
  68.   printf("Total de acrescimos: RS%.2f\n", total_acrescimos);
  69.   printf("Novo salario: RS%.2f\n", novo_sal);
  70.  
  71.   getch();
  72.   return 0;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement