Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ProgammingBasics;
- import java.util.Scanner;
- public class Traveling {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine();
- double vacantion = 0;
- if (budget <= 100) {
- if (season.equalsIgnoreCase("summer")) {
- vacantion = budget * 0.30;
- System.out.println("Somewhere in Bulgaria");
- System.out.printf("Camp" + " - %.2f", vacantion);
- } else if (season.equalsIgnoreCase("winter")) {
- vacantion = budget * 0.70;
- System.out.println("Somewhere in Bulgaria");
- System.out.printf("Hotel" + " - %.2f", vacantion);
- }
- } else if (budget > 100 && budget <= 1000) {
- if (season.equalsIgnoreCase("summer")) {
- vacantion = budget * 0.40;
- System.out.println("Somewhere in Balkans");
- System.out.printf("Camp" + " - %.2f", vacantion);
- } else if (season.equalsIgnoreCase("winter")) {
- vacantion = budget * 0.80;
- System.out.println("Somewhere in Balkans");
- System.out.printf("Hotel" + " - %.2f", vacantion);
- }
- } else if (budget > 1000) {
- {
- vacantion = budget * 0.90;
- System.out.println("Somewhere in Europe");
- System.out.printf("Hotel" + " - %.2f", vacantion);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement