C# C# Collections Arrays Jagged Arrays

help plz

Challenge Task 1 of 1

Return a multiplication table consisting of an array of arrays. The table should contain all of the products of integers from 0 to maxFactor. For example, if maxFactor is 3 the resulting multiplication table should contain the following: 0 0 0 0 0 1 2 3 0 2 4 6 0 3 6 9

Important: In each task of this code challenge, the code you write should be added to the code from the previous task. Restart Preview Get Help Check Work Math.cs

1 namespace Treehouse.CodeChallenges 2 { 3 public static class MathHelpers 4 { 5 public static int[,] BuildMultiplicationTable(int maxFactor) 6 { 7 for (int i = 0; i < array.Length; i++) 8 { 9 System.Console.Write("maxFactor({0}): ", i); 10 } 11 ​ 12 ​ 13 } 14 } 15 } 16 ​

Math.cs
namespace Treehouse.CodeChallenges
{
    public static class MathHelpers
    {
        public static int[,] BuildMultiplicationTable(int maxFactor)
        {
            for (int i = 0; i <  array.Length; i++)
        {
            System.Console.Write("maxFactor({0}): ", i);
        }


        }
    }
}

1 Answer

Steven Parker
Steven Parker
172,140 Points

It looks like you asked this three times.

Here are the hints I gave on the original question:

  • you don't need to write to the console, just build and return the table.
  • you might need a second loop nested inside the first to handle both dimensions.
  • it's a multiplication table — don't forget to multiply.

I don't get it either. I can't see any similarity between the 9-minute video and the challenge.

Do you have to type this below?

csharp> class Cell

{ public string Contents { get; set; } ?