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 sesson = scanner.nextLine();
- double price = 0;
- String destinstion = "";
- String typeOfAccommodation = "";
- if (budget <= 100) {
- if ("Summer".equals(sesson)) {
- price = budget*0.7;
- typeOfAccommodation = "Camp";
- } else if ("Winter".equals(sesson)) {
- price = price * (1 - 0.7);
- typeOfAccommodation = "Hotel";
- }
- destinstion = "Bulgarian";
- } else if (budget <= 1000) {
- if ("Summer".equals(sesson)) {
- price = budget * (1 - 0.4);
- typeOfAccommodation = "Camp";
- } else if ("Winter".equals(sesson)) {
- price = price * (1 - 0.8);
- typeOfAccommodation = "Camp";
- }
- destinstion = "Balkans";
- } else {
- if ("Summer".equals(sesson)) {
- price = budget * (1 - 0.9);
- typeOfAccommodation = "Camp";
- } else if ("Winter".equals(sesson)) {
- price = price * (1 - 0.9);
- typeOfAccommodation = "Camp";
- }
- destinstion = "Europe";
- }
- System.out.printf("Somewhere in %s",destinstion).println();
- System.out.printf("%s – %.2f",typeOfAccommodation,price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement