Find The Given Number Is Within The Range - Java Quiz Question


Write a program to check the given number is included in given range.

Input (Input Value, Range Start, Range End ) Output
27.89
10.23
34.56
true
-2.34
-10.23
-1.25
true
0.023
0.034
0.015
true
10.23
11.23
17.89
false
9.78
2.23
7.89
false
null
11.23
17.89
false
10.89
null
17.89
false
10.89
9.23
null
false



class NumberInRange
{
    public static void main(String s[])
    {
        Double inputValue = 23.45;
        Double rangeStart = 10.23;
        Double rangeEnd = 35.78;
        boolean result = isInIncludingRange(inputValue, rangeStart, rangeEnd);
        System.out.println("Is the number "+inputValue+" is in including range of start value "+rangeStart+" and end value "+rangeEnd+" ? "+result);

    }


        public static boolean isInIncludingRange(Double inputValue, Double rangeStart, Double rangeEnd)
        {
            boolean result = false;
            return result;
        }

}