I am supposed to be making a dictionary of lists in order to show the scores of different peoples test, the final outcome is supposed to look like this:
Currently my code looks like this, the issue I am having is that the numbers are printing 3 times, not once like shown. HELP PLEASE!
static void Main(string[] args)
{
Random myRandomGenerator = new Random();
Dictionary<string, List<int>> table = new Dictionary<string, List<int>>();
table["Meuleveld, McKenzie"] = new List<int>(){ myRandomGenerator.Next(60, 100), myRandomGenerator.Next(60,100), myRandomGenerator.Next(60,100)};
table["McGuire, Matthew"] = new List<int>(){ myRandomGenerator.Next(60, 100), myRandomGenerator.Next(60, 100), myRandomGenerator.Next(60, 100) };
table["Anderton, Paitlyn"] = new List<int>(){ myRandomGenerator.Next(60, 100), myRandomGenerator.Next(60, 100), myRandomGenerator.Next(60, 100) };
table["Moore, Jeni"] = new List<int>(){ myRandomGenerator.Next(60, 100), myRandomGenerator.Next(60, 100), myRandomGenerator.Next(60, 100) };
foreach (string name in table.Keys)
{
List<int> value = table[name];
foreach (int valueList in value)
{
Console.WriteLine($"{name} exam scores: {valueList}, {valueList}, {valueList}");
Console.ReadKey();
}
}
}