Question
If a user wants to spend more than $200, suggest exclusive suites. If the country is France, also suggest rooms in palaces. If a user
If a user wants to spend more than $200, suggest exclusive suites. If the country is France, also suggest rooms in palaces.
If a user wants to spend more than $250, If the country is Germany. suggest exclusive suites
My code
System.out.println("Enter the country you want to visit: "); //input prompt
String country=in.next();//input
if(country.equals("France")){ System.out.println("I suggest exclusive suites."); System.out.print("I also suggest rooms in palaces."); } else(country.equals("Germany")) { System.out.println("I suggest exclusive suites."); /* Executes when the boolean expression 1 is true */ }
}
}
System.out.println("Enter the country you want to 40 39 4 / 4 pts - Click for details PASSE String country=in.next(); //input, 250 france 0 / 4 pts - Click for details FAILE if(country.equals("France"), System.out.println("I suggest exclusive suites.") System.out.print("I also suggest rooms in palaces /* Executes when the boolean expression 1 is try 250 France 4 / 4 pts - Click for details PASSE 250 Germany . 0/4 pts - Click for details FAILE 61 }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started