Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Journey {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine();
- double cost = 0;
- //• Първи ред – "Somewhere in [дестинация]“ измежду "Bulgaria", "Balkans" и "Europe"
- //• Втори ред – "{Вид почивка} – {Похарчена сума}"
- if (budget <= 100 && season.equals("summer")) {
- cost = budget * 0.30;
- System.out.printf("Somewhere in Bulgaria %n");
- System.out.printf("Camp - %.2f", cost);
- } else if (budget < 100 && season.equals("winter")) {
- cost = budget * 0.70;
- System.out.printf("Somewhere in Bulgaria %n");
- System.out.printf("Hotel - %.2f", cost);
- }
- if (budget >100 && budget <= 1000 && season.equals("summer")) {
- cost = budget * 0.40;
- System.out.printf("Somewhere in Balkans %n");
- System.out.printf("Camp - %.2f", cost);
- } else if (budget > 100 && budget <= 1000 && season.equals("winter")) {
- cost = budget * 0.80;
- System.out.printf("Somewhere in Balkans %n");
- System.out.printf("Hotel - %.2f", cost);
- }
- if (budget > 1000){
- cost = budget * 0.90;
- System.out.printf("Somewhere in Europe %n");
- System.out.printf("Hotel - %.2f", cost);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement