Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class put {
- public static void main(String[] args)
- {
- //sezon
- Scanner scanner = new Scanner(System.in);
- double a = Double.parseDouble(scanner.nextLine());
- String SummerOrWinter = scanner.nextLine();
- if (a <= 100)
- {
- //mqsto - lqto
- System.out.println("Somewhere in Bulgariq");
- if (SummerOrWinter.equals("summer"))
- {
- int percentage = 30;
- double percentage_of = a;
- Double calculate_percentage = (double) percentage_of / 100 * percentage;
- System.out.println("Camp - " + Math.floor(calculate_percentage * 100.0) / 100.0);
- }
- //zima
- if (SummerOrWinter.equals("winter"))
- {
- int percentage = 70;
- double percentage_of = a;
- Double calculate_percentage = (double) percentage_of / 100 * percentage;
- System.out.println("Hotel - " + Math.floor(calculate_percentage * 100.0) / 100.0);
- }
- }else if (a <= 1000) {
- //nqkde v balkanite xd
- System.out.println("Somewhere in Balkans");
- //za lqto
- if (SummerOrWinter.equals("summer"))
- {
- int percentage = 40;
- double percentage_of = a;
- Double calculate_percentage = (double) percentage_of / 100 * percentage;
- System.out.println("Camp - " + Math.floor(calculate_percentage * 100.0) / 100.0);
- }
- //za zima
- if (SummerOrWinter.equals("winter"))
- {
- int percentage = 80;
- double percentage_of = a;
- Double calculate_percentage = (double) percentage_of / 100 * percentage;
- System.out.println("Hotel - " + Math.floor(calculate_percentage * 100.0) / 100.0);
- }
- }else if (a >= 1000) {
- //nqkude v evropa - lqto
- System.out.println("Somewhere in Europe");
- if (SummerOrWinter.equals("summer"))
- {
- int percentage = 90;
- double percentage_of = a;
- Double calculate_percentage = (double) percentage_of / 100 * percentage;
- System.out.println("Camp - " + Math.floor(calculate_percentage * 100.0) / 100.0);
- }
- //zima
- if (SummerOrWinter.equals("winter"))
- {
- int percentage = 90;
- double percentage_of = a;
- Double calculate_percentage = (double) percentage_of / 100 * percentage;
- System.out.println("Hotel - " + Math.floor(calculate_percentage));
- }
- }
- scanner.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement