Define a class named IsInRange1
Provide method main
//Variable Declarations
int low, high, testValue; //store user input
Scanner kbd; //provide input from keyboard
//User Prompt
Prompt user to enter three integers, a low value, a high value and a value to be tested
Store user input in variables low, high, testValue
//Program logic
IF testValue >= low && testValue <= high
Display message “The value testValue is in range”
ELSE
Display message “The value testValue is not in range”
//End Program
1 import java.util.Scanner;
2
3 public class IsInRange
4 {
5 public static void main(String [] args)
6 {
7 int low;
8 int high;
9 int testValue;
10
11 Scanner kbd = new Scanner(System.in);
12
13 System.out.println("Please enter the low value: ");
14 low = kbd.nextInt();
15 System.out.println("Please enter the high value: ");
16 high = kbd.nextInt();
17
18 System.out.println("Please enter the value to be tested: ");
19 testValue = kbd.nextInt();
20
21 if(testValue >= low && testValue <= high)
22 System.out.println("The value " + testValue +
23 " is in range.");
24
25 else
26 System.out.println("The value " + testValue +
27 " is not in range.");
28 }
29 }
30 /*OUTPUT
31 //Test 1
32 Please enter the low value:
33 3
34 Please enter the high value:
35 12
36 Please enter the value to be tested:
37 7
38 The value 7 is in range.
39
40 //Test 2
41 Please enter the low value:
42 9
43 Please enter the high value:
44 3
45 Please enter the value to be tested:
46 6
47 The value 6 is not in range.
48 */