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;
- switch (season) {
- case "summer":
- if (budget <= 100) {
- house = "Camp";
- destination = "Bulgaria";
- price = 0.3 * budget;
- } else if (budget <= 1000) {
- house = "Camp";
- destination = "Balkans";
- price = 0.4 * budget;
- } else {
- destination = "Europe";
- house = "Hotel";
- price = 0.9 * budget;
- break;
- }
- case "winter":
- if (budget <= 100) {
- house = "Hotel";
- destination = "Bulgaria";
- price = 0.7 * budget;
- } else if (budget <= 1000) {
- house = "Hotel";
- destination = "Balkans";
- price = 0.8 * budget;
- } else {
- house = "Hotel";
- destination = "Europe";
- price = 0.9 * budget;
- break;
- }
- }
- System.out.printf("Somewhere in %s", destination).println(); //zapomni!!!!
- System.out.printf("%s - %.2f", house,price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement