Basically I would like the user to input 3 values into a textbox and have a button that calculates the total of the 3 inputted values. I thought I could read the user input and then convert it into an integer and from that apply a formula to work out fnum+snum+tnum = total; What I have done so far does not work can anybody guide me thanks.
int num1 = int.Parse(weighting1.Text);
int num2 = int.Parse(weighting2.Text);
int num3 = int.Parse(weighting3.Text);
total = num1+num2+num3;
int total = int.parse(lTotal.Text);
// Code to display the variable
instead of int.parse(lTotal.Text) you need to assign total’s string value to label
Your code should be: