I was given this homework assignment, which I have been having a hard time with. The form was written and we had to write the class. Currently when I run the program my equa
In the main code, you have called the Equal() method like this:
if (newValue)
calc.Equals();
else
calc.Equals(displayValue); //Your class do not have this.
So, you should do this first
//I am not sure why you need to pass in the displayValue parameter, so I presume it would not return anything.
public void Equal(Decimal displayValue)
{
//Do the things you suppose to do
}
And for your 9 + 9 = 9 problem, it is simply because in your code, you only press your click event Add_Button for once. Make a break point at your Add()
method. Then try to do like this:
9 --> press your Add_Button --> 9 --> press your Add_Button --> check your currentValue