In school, for a C# course, they gave us a very mystical assignment. There is the following code in Main() and we have to write the class Group.
Group group = new Group(3);
group["wholenumber"] = 123;
group["decimalnumber"] = 456.78;
group["text"] = "Hello world!";
double sum = (double)(int)group["wholenumber"] + (double)group["decimalnumber"];
Console.WriteLine("Sum of numbers is {0}", sum);
Does that make any sense? I thought you cant use strings as index? I would understand if there was variable names as index, so they could pass for finals, but now I don't get it. I tried to use Google and found dictionaries which are like arrays and can use a string as an index, but all values are different - first is int, second double and last is string, so dictionary won't work.
At the moment we are talking about static classes, constants, destructors and indexers
Thanks in advance
Dictionary<string,object>will workgroupis a keyword in C#. You should avoid naming your variablesgroup. Use another name instead.