Advertisement
Guest User

Untitled

a guest
Oct 4th, 2019
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class tradeComissions {
  4. public static void main(String[] args) {
  5. Scanner console = new Scanner(System.in);
  6. String city = console.nextLine().toLowerCase();
  7. int volume = Integer.parseInt(console.nextLine());
  8. //Double quantity = Double.parseDouble(console.nextLine());
  9. switch (city){
  10. case "sofia":
  11. if (0<=volume&&volume<=500) {
  12. System.out.printf("%.2f", volume * 0.05);
  13. }
  14. else if(500<volume&&volume<=1000 ){
  15. System.out.printf("%.2f", volume * 0.07);
  16.  
  17. }
  18. else if(1000<volume&&volume<=10000 ){
  19. System.out.printf("%.2f", volume * 0.08);
  20.  
  21. }
  22. else if(10000<volume ){
  23. System.out.printf("%.2f", volume * 0.12);
  24.  
  25. }
  26. break;
  27. case "plovdiv":
  28. if (0<=volume&&volume<=500) {
  29. System.out.printf("%.2f", volume * 5.5);
  30. }
  31. else if(500<volume&&volume<=1000 ){
  32. System.out.printf("%.2f", volume * 8);
  33.  
  34. }
  35. else if(1000<volume&&volume<=10000 ){
  36. System.out.printf("%.2f", volume * 12);
  37.  
  38. }
  39. else if(10000<volume ){
  40. System.out.printf("%.2f", volume * 14.5);
  41.  
  42. }
  43. break;
  44. case "varna":
  45. if (0<=volume&&volume<=500) {
  46. System.out.printf("%.2f", volume * 4.5);
  47. }
  48. else if(500<volume&&volume<=1000 ){
  49. System.out.printf("%.2f", volume * 7.5);
  50.  
  51. }
  52. else if(1000<volume&&volume<=10000 ){
  53. System.out.printf("%.2f", volume * 10);
  54.  
  55. }
  56. else if(10000<volume ){
  57. System.out.printf("%.2f", volume * 13);
  58.  
  59. }break;
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement