What Norm said is correct. A little thing called: "scope" hides variables. When code is executed, it looks for variable names in the closest scope. You have declared monthlypay1 as a class instance...