Menu
Coddy logo textTech

Data Collection Setup

Part of the Logic & Flow section of Coddy's C# journey — lesson 40 of 66.

challenge icon

Challenge

Easy

In this project, you'll build a data analysis system that processes student scores. First, create the foundation for collecting and validating input data.

Create a class called DataCollector with these methods:

  1. CreateScoreGrid(int students, int assignments): Creates and returns a jagged array of integers (int[][]) with the specified dimensions to store student scores.
  2. ValidateScore(int score): Returns true if the score is valid (between 0 and 100 inclusive), otherwise false.
  3. PopulateWithDefaultValues(int[][] scoreGrid): Fills the entire grid with a default score of -1 (representing "not graded yet") and returns the updated grid.

IMPORTANT: Do not modify the test code at the bottom of the file. It will be used to validate your implementation.

Try it yourself

using System; // Don't delete this line

public class DataCollector
{
    public static int[][] CreateScoreGrid(int students, int assignments)
    {
        // Write your code here
    }
    
    public static bool ValidateScore(int score)
    {
       // Write your code here
    }
    
    public static int[][] PopulateWithDefaultValues(int[][] scoreGrid)
    {
        // Write your code here
    }
}

All lessons in Logic & Flow