title: How do i stop part of a method being called?
body: <p>I'm pretty new to coding and I'm creating a quiz using C#, however i'm running into problems when trying to increment the total score when an answer is answered correctly.  the code calling the method is:</p>
  
  <pre><code>    private void nextQuestionButton1_Click(object sender, EventArgs e)
      {
          if (majNugentRadioButton.Checked)
          {
              // increment total score
              Program.Score();
              // load question 2
              Question2 win2 = new Question2();
              win2.Show();
              this.Close();
          }
          else
          {
              // load question 2
              Question2 win2 = new Question2();
              win2.Show();
              this.Close();
          }
      }
  }
  </code></pre>
  
  <p>And the code for the Program.Score(); method is:</p>
  
  <pre><code>    static public void Score()
      {
          int totalScore = 0;
          totalScore++;
      }
  </code></pre>
  
  <p>When i call this method from the 2nd question it sets the totalScore back to 0, how can i get it so that it only assigns the value of 0 the first time it's called?</p>