Advertisement
Marchoy1991

summer trip

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