Пример #1
0
        private void tossButton_Click(object sender, EventArgs e)
        {
            //Create a Coin Object
            Coin myCoin = new Coin();

            //Clear the listbox.
            outputListBox.Items.Clear();

            //Toss the coin five times.
            for (int count = 0; count < 5; count++)
            {
                myCoin.Toss();
                //Display the side that is up.
                outputListBox.Items.Add(myCoin.GetSideUp());
            }
        }