I have a multidimensional array that represents the days of the week (Monday, Tuesday etc..) and weeks for a month (Week 1 etc..), which shows the amount of products made on each day. The array is being filled by user entry (Input box) and I am trying to figure out a way to prompt the user for a week: Week 1 etc and a day. I know of IndexOf but that gives me the index not the value in the index.
My code is:
int[,] week = new int[4, 5];
for (int Row = 0; Row < week.GetLength(0); Row++)
{
if (Row == 0)
{
Week = "Week 1 ";
}
else if (Row == 1)
{
Week = "Week 2 ";
}
else if (Row == 2)
{
Week = "Week 3 ";
}
else if (Row == 3)
{
Week = "Week 4 ";
}
txtOutput.Text += "\r\n" + Week + ": ";
for (int Col = 0; Col < week.GetLength(1); Col++)
{
if (Col == 0)
{
Day = "Monday";
}
else if (Col == 1)
{
Day = "Tuesday";
}
else if (Col == 2)
{
Day = "Wednesday";
}
else if (Col == 3)
{
Day = "Thursday";
}
else if (Col == 4)
{
Day = "Friday";
}
string value = Microsoft.VisualBasic.Interaction.InputBox("Enter the amount of products made on " + Day + " for " + Week, "Product Amount");
week[Row, Col] = Int32.Parse(value);
txtOutput.Text += " ";
txtOutput.Text += value + " ";
}
}
I will probably have to make some custom method for this as there is no inbuilt method I know of but I cannot figure out what this would look like. Any help would be appreciated.