Menu
Question Index
...


Write a program to print the runs per over chart using ball numbers as shown below. The runs per ball in every over is given.

Input (int[]) Printed Output
{{0, 1, 3, 1, 0, 2}, {4, 4, 0, 6, 1, 2}, {0, 5, 6, 4, 3, 2}, {1, 3, 4, 6, 1, 2}, {4, 6, 4, 4, 6, 2}, {4, 2, 6, 1, 3, 2}}         6
        6
        5
        5
        5
        5
    6   5
    6   5
    5   4 6
  6 5 6 4 6
  6 5 6 4 5
  5 4 5 4 5
  4 4 4 3 5
  4 4 4 3 4
  4 4 4 3 3
  4 3 4 3 3
  4 3 4 2 3
  4 3 4 2 3
  2 3 3 2 3
6 2 3 3 2 3
6 2 3 3 2 2
4 2 2 3 2 2
3 1 2 2 1 1
3 1 2 2 1 1
3 1 2 2 1 1
2 1 2 1 1 1
- - - - - -
1 2 3 4 5 6
{{0, 1, 3, 1, 0, 2}, {0, 2, 0, 1, 3, 0}, {3, 0, 0, 4, 2, 0}}     5
    5
6   4
6 5 4
4 5 4
3 5 4
3 4 1
3 2 1
2 2 1
- - -
1 2 3
{{4, 0, 2, 1, 6, 6}, {3, 4, 2, 2, 6, 6}, {0, 1, 4, 2, 2, 2}, {6, 4, 2, 1, 6, 2}, {0, 1, 2, 4, 6, 2}, {4, 4, 3, 2, 1, 0}, {3, 1, 4, 6, 2, 1}, {1, 4, 6, 2, 3, 1}, {6, 1, 2, 3, 4, 1}}   6
  6
  6   6
  6   6
6 6   5
6 6   5
6 5   5     6 6 6
6 5   5     5 5 5
6 5   5 6   5 5 5
6 5   5 6 5 4 5 5
5 5   4 5 4 4 4 5
5 5   3 5 4 4 4 4
5 4 6 3 5 3 4 3 4
5 4 6 2 5 3 4 3 4
5 3 5 2 5 3 4 3 3
5 3 5 2 5 2 3 3 3
4 2 4 2 4 2 3 3 2
3 2 4 1 4 2 3 3 1
3 2 3 1 4 2 3 2 1
1 2 3 1 4 1 2 2 1
1 1 3 1 3 1 1 2 1
1 1 3 1 3 1 1 2 1
1 1 2 1 2 1 1 1 1
- - - - - - - - -
1 2 3 4 5 6 7 8 9
{{1, 0, 2, 4, 6, 2}, {2, 3, 4, 1, 2, 1}, {6, 2, 4, 1, 2, 4}, {6, 1, 3, 2, 1, 4}}     6
    6
    6 6
    6 6
6   5 6
6   5 6
5 6 4 5
5 5 3 4
5 5 3 4
5 4 3 3
5 3 3 3
5 3 2 3
4 3 2 2
4 3 1 1
4 2 1 1
4 2 1 1
3 2 1 1
3 1 1 1
1 1 1 1
- - - -
1 2 3 4
 

class PrintRunsPerOverChartAdvanced

{    public static void main(String s[])
    {
        int[][] input = {{0, 1, 3, 1, 0, 2}, {4, 4, 0, 6, 1, 2}, {0, 5, 6, 4, 3, 2}, {1, 3, 4, 6, 1, 2}, {4, 6, 4, 4, 6, 2}, {4, 2, 6, 1, 3, 2}};
        printChart(input);

    }


public static void printChart(int[][] allOvers) {
//Write code here to print runs per over using numbers
}

//Write any additional methods if required
}

Doubts

Problems

Topic: Learn Arrays And Loops

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App