targil1

                Never    
Java
       
t java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int rooms, pay = 0;
        boolean ifDoplex = false;
        System.out.println("enter the number of you rooms.");
        rooms = s.nextInt();
        System.out.println("enter true or false for doplex.");
        ifDoplex = s.nextBoolean();


        // checking how much rooms we got from the user and return the value he need to pay
        switch (rooms) {
            case 3:
                pay = 120;
                break;
            case 4:
                pay = 150;
                break;
            case 5:
                if (ifDoplex) {
                    pay = 200;
                } else {
                    pay = 180;
                }
        }
        System.out.println("you need to pay: " + pay);


    }
}

Raw Text