Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Comission {
  4. public static void main(String[] args) {
  5.  
  6. Scanner scanner = new Scanner (System.in);
  7.  
  8. String town = scanner.nextLine();
  9. double sellstaff = Double.parseDouble(scanner.nextLine());
  10. double result = 0;
  11.  
  12. if (town.equals("Sofia")){
  13. if (sellstaff >=0 && sellstaff <=500){
  14. result = sellstaff * 0.05;
  15. System.out.printf("%.2f",result);
  16. }else if (sellstaff>500&&sellstaff<=1000){
  17. result = sellstaff *0.07;
  18. System.out.printf("%.2f",result);
  19. }else if (sellstaff>1000 && sellstaff<=10000){
  20. result = sellstaff * 0.08;
  21. System.out.printf("%.2f",result);
  22. }else if (sellstaff>10000) {
  23. result = sellstaff * 0.12;
  24. System.out.printf("%.2f",result);
  25. }else {
  26. System.out.printf("error");
  27. }
  28.  
  29.  
  30. }else if (town.equals("Varna")){
  31. if (sellstaff >=0 && sellstaff <=500){
  32. result = sellstaff * 0.045;
  33. System.out.printf("%.2f",result);
  34. }else if (sellstaff >500 && sellstaff<=1000){
  35. result = sellstaff * 0.075;
  36. System.out.printf("%.2f",result);
  37. }else if (sellstaff >1000 && sellstaff<=10000){
  38. result = sellstaff * 0.10;
  39. System.out.printf("%.2f",result);
  40. }else if (sellstaff>10000){
  41. result = sellstaff * 0.13;
  42. System.out.printf("%.2f",result);
  43. }else {System.out.printf("error");
  44. }
  45.  
  46. }else if (town.equals("Plovdiv")){
  47.  
  48. if (sellstaff>=0 && sellstaff <=500){
  49. result = sellstaff * 0.055;
  50. System.out.printf("%.2f",result);
  51. }else if (sellstaff > 500 &&sellstaff<=1000){
  52. result = sellstaff * 0.08;
  53. System.out.printf("%.2f",result);
  54. }else if (sellstaff>1000&& sellstaff<=10000){
  55. result = sellstaff * 0.12;
  56. System.out.printf("%.2f",result);
  57. }else if (sellstaff>10000){
  58. result = sellstaff * 0.145;
  59. System.out.printf("%.2f",result);
  60. }else{
  61. System.out.printf("error");
  62. }
  63.  
  64. }else
  65. System.out.printf("error");
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement