I am wondering what I am doing wrong, as I am trying to make a menu, in which it needs to calculate three different courses together in predefined values, however I seem to be doing the conversions wrong, as I cant seem to make it work right.
int a, b, c;
textBox4.Text = (a + b + c).ToString();
if (comboBox1.Text == "Tzatziki")
{
a = 35;
}
else if (comboBox1.Text == "Carpaccio")
{
a = 40;
}
else if (comboBox1.Text == "Bruscetta")
{
a = 30;
}
else if (comboBox1.Text == "Shrimp Cocktail")
{
a = 40;
}
if (comboBox2.Text == "Sirloin")
{
b = 225;
}
else if (comboBox2.Text == "Lamb")
{
b = 195;
}
else if (comboBox2.Text == "Salmon")
{
b = 170;
}
else if (comboBox2.Text == "Veggy")
{
b = 100;
}
if (comboBox1.Text == "Chocolate Cake")
{
c = 45;
}
else if (comboBox1.Text == "Pancakes")
{
c = 35;
}
else if (comboBox1.Text == "Waffles")
{
c = 40;
}
else if (comboBox1.Text == "Sundae")
{
c = 38;
}
}
Would appreciate the advice, kinda new to C# programming :)