How do I code variables for a simple "running total" box without using an array?
IE: I have a "Points Earned" text box that the user inputs a value into. I have another output "Total Points Earned" box that keeps a running count of all points earned every time the user inputs a new value.
I've been doing this (which is obviously wrong):
//declare variables
decimal decPointsEarned = Convert.ToDecimal(txtPointsEarned.Text);
decimal decTotalPointsEarned;
//run code
decTotalPointsEarned = decPointsEarned + decPointsEarned;
//display code
lblTotalPointsEarned = decTotalPointsEarned.ToString();