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