For the most part this does work the problem is the message box pops up for Andrea and Brittany but it works correctly for Eric. If I try to put the else statement after each if statement it still pops up on Brittany, and Andrea, but then also pops up on Eric then. Can someone tell me what i am doing wrong.
private void button1_Click(object sender, EventArgs e)
{
String Andrea;
String Brittany;
String Eric;
if (textBox1.Text == "Andrea")
{
Commission.Text = (Convert.ToDouble(textBox2.Text) / 10).ToString();
}
if (textBox1.Text == "Brittany")
{
Commission.Text = (Convert.ToDouble(textBox2.Text) / 10).ToString();
}
if (textBox1.Text == "Eric")
{
Commission.Text = (Convert.ToDouble(textBox2.Text) / 10).ToString();
}
else
{
MessageBox.Show("The spelling of the name is incorrect", "Bad Spelling");
}
{
}
}