Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Volleyball {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine();
- String sleep = "";
- String destination = "";
- switch (season) {
- case "Summer":
- if (100 <= budget) {
- sleep = "Camp";
- destination = "Bulgaria";
- budget = budget * 0.7;
- } else if ((budget > 100 && budget <= 1000)) {
- sleep = "Camp";
- destination = "Balkans";
- budget = budget * 0.6;
- } else {
- destination = "Europe";
- sleep = "Hotel";
- budget = budget * 0.1;
- }
- case "Winter":
- if (100 <= budget) {
- sleep = "Hotel";
- destination = "Bulgaria";
- budget = budget * 0.3;
- } else if ((budget > 100 && budget <= 1000)) {
- sleep = "Hotel";
- destination = "Balkans";
- budget = budget * 0.2;
- } else {
- destination = "Europe";
- sleep = "Hotel";
- budget = budget * 0.1;
- }
- }
- System.out.printf("Somewhere in %s ",destination).println("");
- System.out.printf("%s - %.2f",sleep,budget);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement