title: c# for loops - adding and subtracting totals
body: <p>I am creating a pizza menu for a college project and I have a drinks section. I have a numericupdown for the user to select the amount of the certain drink they would like. I have been able to create a for loop for adding onto the total when the value of the numericupdown is increased but I am struggling to find out a way to subtract £0.90 from the total value when the value of the numericupdown is decreased.</p>
  
  <p><strong>Code for the cola numericupdown</strong></p>
  
  <pre><code>private void numCola_ValueChanged(object sender, EventArgs e)
  {
    for (int i = 1; i &lt; 2; i++)
    {
     Total = Total + Cola;
     lblTotal.Text = Total.ToString("C");
    }
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Now I have found out I need to create a new event which is updating totals, I have added this method to my cheese pizza and extra cheese. However when I have selected both of these (Total = £4.00) and then I have 1 cola, the first cola only charges £0.40 instead of £0.90.</p>
  
  <pre><code>        private void UpdateTotal()
          {
              Total = Convert.ToDouble(radCheeseTrad.Checked) * CheeseTraditional;
              Total += Convert.ToDouble(chkCheeseExtraCheese.Checked) * ExtraCheese;
              Total += Convert.ToDouble(numCola.Value) * Cola;
              lblTotal.Text = $"{Total:C}";
          }
  
          private void numCola_ValueChanged(object sender, EventArgs e)
          {
              UpdateTotal();
          }
  
          private void radCheeseTrad_MouseClick(object sender, MouseEventArgs e)
          {
              lstOrder.Items.Add("Cheese and Tomato Traditional");
              UpdateTotal();
          }
  
          private void chkCheeseExtraCheese_MouseClick(object sender, MouseEventArgs e)
          {
              lstOrder.Items.Add("Extra Cheese");
              UpdateTotal();
              chkCheeseExtraCheese.Checked = false;
          }
  </code></pre>