Me wants to take a report on the number of rounds participated by each team and their scores in each round. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Me wants to take a report on the number of rounds participated by each team and their scores in each round.

Please help me out .... I'm facing error 🥺 The report should contain number of times each team participated and their scores in each attempt. Finally, it should display all the teams with their scores and its total. How can you help them to generate the report using jagged arrays in C#. (Hint: The number of attempts taken by each team varies.) From the Main method get input from the user and call the below method to return the results and display the result. public static String GetTotalScore(int[][] array) //Method should accept a jagged array and return the result as given in the sample output. Sample Input: Enter the number of teams: 2 No.of attempts for team 1: 2 No.of attempts for team 2: 3 Enter the score for team 1: 100 120 Enter the score for team 2: 200 150 150 Sample Output: Team 1 Total Score is 220 . Team 2 Total Score is 500 https://code.sololearn.com/cEFbOreOhW1w/?ref=app

7th May 2021, 5:45 AM
ㅤ Tweetu 😆 ㅤㅤ
ㅤ  Tweetu 😆 ㅤㅤ - avatar
3 Answers
+ 4
-> variable numOfTeams, attemptsNo are local and are therefore not accessible outside it's block. So you need to declare above so to be accessible. line 30: for (var i = 0; i < numOfTeams; i++) -> all arrays(even jagged array) start with index 0 and that's why we have initialize i = 0 in line 30 of the code. (check the code I've posted) https://code.sololearn.com/ciV0BBq48jT8/?ref=app
7th May 2021, 6:49 AM
Rohit
+ 7
rkk Thank you so much bro 🙏 🙃👍
7th May 2021, 6:58 AM
ㅤ Tweetu 😆 ㅤㅤ
ㅤ  Tweetu 😆 ㅤㅤ - avatar
+ 4
You will need to input something like this because of the poor interactiveness of the SoloLearn input taking system. 2 2 3 100 120 220 150 150
7th May 2021, 6:52 AM
Rohit