Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Vacation {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine();
- String location = "", place = "";
- if (season.equals("Summer")) {
- location = "Alaska";
- } else {
- location = "Morocco";
- }
- if (budget > 3000) {
- place = "Hotel";
- budget *= 0.90;
- } else if (budget > 1000) {
- if (season.equals("Summer")) {
- budget *= 0.80;
- } else {
- budget *= 0.60;
- }
- place = "Hut";
- } else if (budget > 0) {
- if (season.equals("Summer")) {
- budget *= 0.65;
- } else {
- budget *= 0.45;
- }
- place = "Camp";
- }
- System.out.printf("%s - %s - %.2f\n", location, place, budget);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement