Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. /*TABELA DAS GRATIFICACOES
  2. SALÁRIO ATÉ R$ 350,00 GRATIFICACAO: R$ 100,00
  3. SALÁRIO DE R$ 350,00 ATÉ R$ 600,00 GRATIFICACAO: R$ 75,00
  4. SALÁRIO DE R$ 600,00 ATÉ R$ 900,00 GRATIFICACAO: R$ 50,00
  5. SALARIO ACIMA DE R$ 900,00 GRATIFICACAO R$ 35,00
  6. Observação: Exercício retirado do livro Fundamentos da Programação de Computadores*/
  7.  
  8. import java.util.Scanner;
  9. import java.text.DecimalFormat;
  10.  
  11. public class Ex12 {
  12.  
  13. public static void main(String[] args) {
  14.  
  15. Scanner read = new Scanner(System.in);
  16. DecimalFormat df = new DecimalFormat("0.00");
  17.  
  18. float sal;
  19.  
  20. System.out.println(" ================================= ");
  21. System.out.println(" = Calcula Salario Liquido =");
  22. System.out.println(" ================================= ");
  23.  
  24. System.out.print("Digite o salario do funcionario em R$ ");
  25. sal = read.nextFloat();
  26.  
  27. if (sal<350) {
  28. System.out.println("O salario liquido desse funcionario e R$ "+df.format((sal-100)*0.93+100));
  29. }
  30. else if (sal>=350 && sal<600) {
  31. System.out.println("O salario liquido desse funcionario e R$ "+df.format((sal-75)*0.93+75));
  32. }
  33. else if (sal>=600 && sal<900) {
  34. System.out.println("O salario liquido desse funcionario e R$ "+df.format((sal-50)*0.93+50));
  35. }
  36. else {
  37. System.out.println("O salario liquido desse funcionario e R$ "+df.format((sal-35)*0.93+35));
  38. }
  39.  
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement