mariobronze
9/27/2017 - 2:23 AM

Csharp Tests

Csharp Test

 private void button2_Click(object sender, EventArgs e)
        {
            int mynumber = 1;
            string myname = "Mario";
            string hisname = "jonh";
            Boolean mycondition = true;

            int a = 1;
            int b = 2;

            //add a number
            a += 2;

            //subtract a number
            a -= 1;

            //multiply
            a *= 4;

            //Divide
            a /= 1;

            //increment 1
            b++;

            //Decrement 1
            a--;

            switch (textBox1 .Text)
            {
                case "Mario":
                    MessageBox.Show(mycondition.ToString(), textBox1.Text);
                    break;
                case "Jonh":
                    MessageBox.Show(mycondition.ToString(), textBox1.Text);
                    break;

                default:
                    MessageBox.Show("Your name isn't important " + b.ToString (), textBox1.Text);
                    break;
            }
        }
    }
}