delqn_marinov

Untitled

Feb 27th, 2020
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class FishingBoat {
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6.  
  7. //int budget = Integer.parseInt(scan.nextLine());
  8. String season = scan.nextLine();
  9. int fishermanCount = Integer.parseInt(scan.nextLine());
  10.  
  11. int priceOfBoat = 0;
  12. switch (season) {
  13. case "Spring":
  14. priceOfBoat = 3000;
  15. if (fishermanCount <= 6) {
  16. double priceOnSale = priceOfBoat * 0.9;
  17.  
  18. } else if (fishermanCount >= 7 && fishermanCount <= 11) {
  19. double priceOnSale = priceOfBoat * 0.85;
  20.  
  21. } else if (fishermanCount > 12) {
  22. double priceOnSale = priceOfBoat * 0.75;
  23. }
  24. break;
  25. case "Summer":
  26. priceOfBoat = 4200;
  27. if (fishermanCount <= 6) {
  28. double priceOnSale = priceOfBoat * 0.9;
  29.  
  30. } else if (fishermanCount >= 7 && fishermanCount <= 11) {
  31. double priceOnSale = priceOfBoat * 0.85;
  32.  
  33. } else if (fishermanCount > 12) {
  34. double priceOnSale = priceOfBoat * 0.75;
  35. }
  36. break;
  37. case "Autumn":
  38. priceOfBoat = 4200;
  39. if (fishermanCount <= 6) {
  40. double priceOnSale = priceOfBoat * 0.9;
  41.  
  42. } else if (fishermanCount >= 7 && fishermanCount <= 11) {
  43. double priceOnSale = priceOfBoat * 0.85;
  44.  
  45. } else if (fishermanCount > 12) {
  46. double priceOnSale = priceOfBoat * 0.75;
  47. }
  48. break;
  49. case "Winter":
  50. priceOfBoat = 2600;
  51. if (fishermanCount <= 6) {
  52. double priceOnSale = priceOfBoat * 0.9;
  53.  
  54. } else if (fishermanCount >= 7 && fishermanCount <= 11) {
  55. double priceOnSale = priceOfBoat * 0.85;
  56.  
  57. } else if (fishermanCount > 12) {
  58. double priceOnSale = priceOfBoat * 0.75;
  59. }
  60. break;
  61.  
  62.  
  63. }
  64.  
  65.  
  66.  
  67.  
  68. }
  69.  
  70.  
  71. }
  72.  
  73. }
RAW Paste Data