Advertisement
YavorGrancharov

Trip

Jan 22nd, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.37 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Trip {
  4.     public static void main(String[] args) {
  5.         Scanner console = new Scanner(System.in);
  6.         double money = Double.parseDouble(console.nextLine());
  7.         String season = console.nextLine();
  8.  
  9.         if (money <= 100 && season.equals("summer")) {
  10.             double percent = money * 0.30;
  11.             System.out.println("Somewhere in Bulgaria");
  12.             System.out.printf("Camp - " + "%.2f", percent);
  13.         } else if (money <= 100 && season.equals("winter")) {
  14.             double percent = money * 0.70;
  15.             System.out.println("Somewhere in Bulgaria");
  16.             System.out.printf("Hotel - " + "%.2f", percent);
  17.         } else if (money > 100 && money <= 1000 && season.equals("summer")) {
  18.             double percent = money * 0.40;
  19.             System.out.println("Somewhere in Balkans");
  20.             System.out.printf("Camp - " + "%.2f", percent);
  21.         } else if (money > 100 && money <= 1000 && season.equals("winter")) {
  22.             double percent = money * 0.80;
  23.             System.out.println("Somewhere in Balkans");
  24.             System.out.printf("Hotel - " + "%.2f", percent);
  25.         } else if (money > 1000) {
  26.             double percent = money * 0.90;
  27.             System.out.println("Somewhere in Europe");
  28.             System.out.printf("Hotel - " + "%.2f", percent);
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement