Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package _03_ConditionalStatementsAdvanced;
- import java.util.Scanner;
- public class Journey {
- 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 rest = "";
- double spentMoney = 0.0;
- if(budget <= 100) {
- destination = "Bulgaria";
- if(season.equals("summer")) {
- rest = "Camp";
- spentMoney = budget * 0.30;
- } else if(season.equals("winter")) {
- rest = "Hotel";
- spentMoney = budget * 0.70;
- }
- }
- else if (budget <= 1000) {
- destination = "Balkans";
- if(season.equals("summer")) {
- rest = "Camp";
- spentMoney = budget * 0.40;
- } else if(season.equals("winter")) {
- rest = "Hotel";
- spentMoney = budget * 0.80;
- }
- }
- else if (budget > 1000) {
- destination = "Europe";
- rest = "Hotel";
- spentMoney = budget * 0.90;
- }
- System.out.printf("Somewhere in %s%n%s - %.2f", destination, rest, spentMoney);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement