Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Gender {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine();
- String destination = " ";
- String house = " ";
- double price = 0;
- if (budget <= 100) {
- destination = "Bulgaria";
- if ("summer".equals(season)) {
- house = "Camp";
- price = budget * 0.3;
- } else if ("winter".equals(season)) {
- house = "Hotel";
- price = budget * 0.7;
- }
- } else if (budget <= 1000) {
- destination = "Balkans";
- if ("summer".equals(season)) {
- house = "Camp";
- price = budget * 0.4;
- } else if ("winter".equals(season)) {
- house = "Hotel";
- price = budget * 0.8;
- }
- } else if (budget > 1000) {
- destination = "Europe";
- house = "Hotel";
- price = budget * 0.9;
- }
- System.out.printf("Somewhere in %s", destination).println();
- System.out.printf("%s - %.2f", house,price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement