Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package NestedConditionalStatements_3.exercises;
- import java.util.Scanner;
- public class Journey {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- double budget = Double.parseDouble(console.nextLine());
- String season = console.nextLine();
- if (budget <= 100) {
- if (season.equals("summer")) {
- System.out.printf("Somewhere in Bulgaria%nCamp - %.2f", budget * 0.3);
- } else {
- System.out.printf("Somewhere in Bulgaria%nHotel - %.2f", budget * 0.7);
- }
- }
- else if (budget <= 1000){
- if (season.equals("summer")){
- System.out.printf("Somewhere in Balkans%nCamp - %.2f", budget * 0.4);
- }else {
- System.out.printf("Somewhere in Balkans%nHotel - %.2f", budget * 0.8);
- }
- }
- else if (budget > 1000){
- if (season.equals("summer")){
- System.out.printf("Somewhere in Europe%nHotel - %.2f", budget * 0.9);
- }else {
- System.out.printf("Somewhere in Europe%nHotel - %.2f", budget * 0.9);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement