Guest User

Untitled

a guest
Nov 16th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package xoamulaptrinh_baitap_lan2;
  7.  
  8. import java.util.Scanner;
  9.  
  10. /**
  11. *
  12. * @author Le Chi Toan
  13. */
  14. public class bai10 {
  15. public double luong_SauThue() {
  16. double salary = 0;
  17. Scanner input = new Scanner(System.in);
  18. System.out.println("Moi nguoi dung nhap luong truoc thue: ");
  19. double luong = input.nextDouble();
  20. if (luong >= 15000000) {
  21. salary = luong - (luong * 0.35);
  22. }
  23. if (luong < 15000000 && luong >= 7000000) {
  24. salary = luong - (luong * 0.21);
  25. }
  26. if (luong < 7000000) {
  27. salary = luong - (luong * 0.11);
  28. }
  29. return salary;
  30. }
  31.  
  32. public static void main(String[] args) {
  33. bai10 t = new bai10();
  34. System.out.println("===================Bai 10: Tinh Khau Tru Luong===================");
  35. double luong=t.luong_SauThue();
  36. System.out.println("Luong sau thue la: "+luong);
  37. }
  38. }
Add Comment
Please, Sign In to add comment