The scenario is as follows,
The decorator needs to enter the height of the room (between 2 and 6 metres), then the length of all four walls (minimum 1 metre; maximum 25 metres).
System.out.println("Enter Height of the room");
Scanner hr = new Scanner(System.in);
int height = hr.nextInt();
System.out.println("Enter Length1 of the room");
Scanner l1 = new Scanner(System.in);
int length = l1.nextInt();
System.out.println("Enter Length2 of the room");
Scanner l2 = new Scanner(System.in);
int length2 = l2.nextInt();
System.out.println("Enter Length3 of the room");
Scanner l3 = new Scanner(System.in);
int length3 = l3.nextInt();
System.out.println("Enter Length4 of the room");
Scanner l4 = new Scanner(System.in);
int length4 = l4.nextInt();
I’ve written the scanners to receive the user’s input, but I don’t how to set a parameter to the scanners. What I want the program to do is receive the user’s input and if (for,example the height of the room is 9 metres) the input is not within the parameters to print an error.