Beispiel #1
0
        private void btnScore_Click(object sender, EventArgs e)
        {
            if (rbAdult.Checked)
                dScoringComputer = new DScore(Scorer.AdultScore);
            if (rbChild.Checked)
                dScoringComputer = new DScore(Scorer.ChildScore);

               try
            {
                correct = Int32.Parse(tbCorrectAns.Text);
                incorrect = Int32.Parse(tbIncorrectAns.Text);
                DisplayPoints(dScoringComputer, correct, incorrect);
            }
            catch (FormatException)
            {
                MessageBox.Show("Please enter two valid whole numbers.");
            }
        }
Beispiel #2
0
        private void btnScore_Click(object sender, EventArgs e)
        {
            if (rbAdult.Checked)
            {
                dScoringComputer = new DScore(Scorer.AdultScore);
            }
            if (rbChild.Checked)
            {
                dScoringComputer = new DScore(Scorer.ChildScore);
            }

            try
            {
                correct   = Int32.Parse(tbCorrectAns.Text);
                incorrect = Int32.Parse(tbIncorrectAns.Text);
                DisplayPoints(dScoringComputer, correct, incorrect);
            }
            catch (FormatException)
            {
                MessageBox.Show("Please enter two valid whole numbers.");
            }
        }
Beispiel #3
0
        public void DisplayPoints(DScore dscoreComputer, int correct, int incorrect)
        {
            int displayScore = dscoreComputer(correct, incorrect);

            lbScore.Text = displayScore.ToString();
        }
Beispiel #4
0
 public void DisplayPoints(DScore dscoreComputer, int correct, int incorrect)
 {
     int displayScore = dscoreComputer(correct, incorrect);
     lbScore.Text = displayScore.ToString();
 }