Get OR Set Accessor

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nk pepcee
    New Member
    • Dec 2015
    • 1

    Get OR Set Accessor

    Code:
    namespace Timed_Maths_Quiz
    {
        public partial class Form1 : Form
        {
            Random randomizer=new Random();
            int addend1;
            int addend2;
            public void StartQuiz
            {
              addend1 = randomizer.Next(51);
              addend2 = randomizer.Next(51);
    
               plusLeftLabel.Text = addend1.ToString();
               plusRightLabel.Text = addend2.ToString();
               sum.Value = 0;
            }
    When I Debug or start the code the IDE generates an error at (addend1 = randomizer.Next (51);).tells me (A get or set accessor expected).

    please help
    Thanks
    Last edited by nk pepcee; Dec 17 '15, 11:49 AM. Reason: not completed
Working...