Question: import java.util.Scanner; public class LodgingInEurope { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(Enter the money you want to spend: );
import java.util.Scanner;
public class LodgingInEurope
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.print("Enter the money you want to spend: ");
int m = input.nextInt();
if(m <= 30)
System.out.print("I suggest camping.");
else if(m > 30 && m <= 45)
System.out.print("Enter your age: ");
int age = input.nextInt();
if(age <= 30)
System.out.println("I suggest youth hostel.");
else
System.out.println("I suggest adult hostel.");
if(m > 45 && m <= 100)
System.out.println("I suggest hotel.");
else if(m > 100 && m <= 200)
System.out.println("I suggest grant hotel.");
else
System.out.print("Enter the country you want to visit: ");
String country = input.next();
System.out.print("I suggest exclusive suites");
if(country.equals("France"))
System.out.print("I also suggest rooms in palaces.");
}
}
error measage i receive is
| at java.util.Scanner.throwFor(Scanner.java:862) |
| at java.util.Scanner.next(Scanner.java:1485) |
| at java.util.Scanner.nextInt(Scanner.java:2117) |
| at java.util.Scanner.nextInt(Scanner.java:2076) |
| at LodgingInEurope.main(LodgingInEurope.java:19) |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
