Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class EP08Journey {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine();
- double tripBudget = 0;
- if (season.equalsIgnoreCase("summer")) {
- if (budget <= 100) {
- System.out.println("Somewhere in Bulgaria");
- tripBudget = budget * 30 / 100;
- System.out.printf("Camp - %.2f", tripBudget);
- } else if (budget <= 1000) {
- System.out.println("Somewhere in Balkans");
- tripBudget = budget * 40 / 100;
- System.out.printf("Camp - %.2f", tripBudget);
- } else {
- System.out.println("Somewhere in Europe");
- tripBudget = budget * 90 / 100;
- System.out.printf("Hotel - %.2f", tripBudget);
- }
- } else if (season.equalsIgnoreCase("winter")) {
- if (budget <= 100) {
- System.out.println("Somewhere in Bulgaria");
- tripBudget = budget * 70 / 100;
- System.out.printf("Hotel - %.2f", tripBudget);
- } else if (budget <= 1000) {
- System.out.println("Somewhere in Balkans");
- tripBudget = budget * 80 / 100;
- System.out.printf("Hotel - %.2f", tripBudget);
- } else {
- System.out.println("Somewhere in Europe");
- tripBudget = budget * 90 / 100;
- System.out.printf("Hotel - %.2f", tripBudget);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment