Advertisement
YoannaSt173

put

Jan 20th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.35 KB | None | 0 0
  1.  
  2.  
  3. import java.util.Scanner;
  4. public class put {
  5.  
  6.     public static void main(String[] args)
  7.    
  8.     {
  9.         //sezon
  10.         Scanner scanner = new Scanner(System.in);
  11.        
  12.         double a = Double.parseDouble(scanner.nextLine());
  13.         String SummerOrWinter = scanner.nextLine();
  14.         if (a <= 100)
  15.         {
  16.             //mqsto - lqto
  17.             System.out.println("Somewhere in Bulgariq");
  18.             if (SummerOrWinter.equals("summer"))
  19.                
  20.             {
  21.                 int percentage = 30;
  22.                 double percentage_of = a;
  23.                 Double calculate_percentage = (double) percentage_of / 100 * percentage;
  24.                 System.out.println("Camp - " + Math.floor(calculate_percentage * 100.0) / 100.0);
  25.             }
  26.             //zima
  27.             if (SummerOrWinter.equals("winter"))
  28.                
  29.             {
  30.                 int percentage = 70;
  31.                 double percentage_of = a;
  32.                
  33.                 Double calculate_percentage = (double) percentage_of / 100 * percentage;
  34.                 System.out.println("Hotel - " + Math.floor(calculate_percentage * 100.0) / 100.0);
  35.             }
  36.            
  37.         }else if (a <= 1000) {
  38.             //nqkde v balkanite xd
  39.             System.out.println("Somewhere in Balkans");
  40.            
  41.             //za lqto
  42.             if (SummerOrWinter.equals("summer"))
  43.                
  44.             {
  45.                
  46.                 int percentage = 40;
  47.                 double percentage_of = a;
  48.                
  49.                 Double calculate_percentage = (double) percentage_of / 100 * percentage;
  50.                 System.out.println("Camp - " + Math.floor(calculate_percentage * 100.0) / 100.0);
  51.                
  52.             }
  53.            
  54.             //za zima
  55.             if (SummerOrWinter.equals("winter"))
  56.                
  57.             {
  58.                 int percentage = 80;
  59.                 double percentage_of = a;
  60.                
  61.                 Double calculate_percentage = (double) percentage_of / 100 * percentage;
  62.                 System.out.println("Hotel - " + Math.floor(calculate_percentage * 100.0) / 100.0);
  63.             }
  64.            
  65.         }else if (a >= 1000) {
  66.            
  67.             //nqkude v evropa - lqto
  68.             System.out.println("Somewhere in Europe");
  69.             if (SummerOrWinter.equals("summer"))
  70.                
  71.             {
  72.                
  73.                 int percentage = 90;
  74.                 double percentage_of = a;
  75.                
  76.                 Double calculate_percentage = (double) percentage_of / 100 * percentage;
  77.                 System.out.println("Camp - " + Math.floor(calculate_percentage * 100.0) / 100.0);
  78.                
  79.             }
  80.            
  81.             //zima
  82.             if (SummerOrWinter.equals("winter"))
  83.                
  84.             {
  85.                 int percentage = 90;
  86.                 double percentage_of = a;
  87.                
  88.                 Double calculate_percentage = (double) percentage_of / 100 * percentage;
  89.                 System.out.println("Hotel - " + Math.floor(calculate_percentage));
  90.             }
  91.         }
  92.        
  93.         scanner.close();
  94.     }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement