info@meritcampus.com    +91-85006-22255
...

Write a program to separate the marks into five bins. The bins should be created using the minimum and maximum marks. In case of rounding error, reduce the range for the highest marks bin.

Input (List) Output (Map)
[12, 16, 19, 31, 39, 42, 46, 49] {12-19=[12, 16, 19], 20-27=[], 28-35=[31], 36-43=[39, 42], 44-49=[46, 49]}
[91, 102, 106, 190, 191, 192, 196, 199, 200] {91-112=[91, 102, 106], 113-134=[], 135-156=[], 157-178=[], 179-200=[190, 191, 192, 196, 199, 200]}
[1, 6, 100, 120, 140, 160, 182, 200, 242, 300, 362, 382, 400, 432, 450] {1-90=[1, 6], 91-180=[100, 120, 140, 160], 181-270=[182, 200, 242], 271-360=[300], 361-450=[362, 382, 400, 432, 450]}
[1, 10, 26, 36, 48, 99, 92, 69, 82, 62, 49] {1-20=[1, 10], 21-40=[26, 36], 41-60=[48, 49], 61-80=[62, 69], 81-99=[82, 92, 99]}

``` class SeparateMarksIntoFiveBins {    public static void main(String s[])    {        List marks = new ArrayList();        marks.add(1);        marks.add(10);        marks.add(26);        marks.add(36);        marks.add(48);        marks.add(49);        marks.add(62);        marks.add(69);        marks.add(82);        marks.add(92);        marks.add(99);        System.out.println("The marks ranges are : " + separateMarksIntoBins(marks));    } public static Map<String, List<Integer>> separateMarksIntoBins(List<Integer> marks) { //Write code here to separate marks into five bins } } ```
0
Wrong
Score more than 2 points