Mutator method for a calculator
So this is very complex to me, since I havent got the hang of java (bluej) so far. But Ill try and explain what the mutator method need to do.
Its a method that lets the user enter a number. It says its passed as a parameter. The result of entering or passing the number depends on the previous action done by the user. If that was a choice of calculation, it is the second or a following number in the calculation otherwise it is the first number.
Im not sure where to start, but a field (a logical) that supposed to keep track of if the next number entered is the first number or the second number in the calculation. And its initialised in the constructor below (ctrlTest)
Furthermore I have a toString method - however, I dont think I need to use that in this method.
public Calculator(int _firstNumber, int _secondNumber, char operatorChar, boolean _ctrlTest)
_firstNumber = firstNumber;
_secondNumber = secondNumber;
operatorChar = ' ';
_ctrlTest = ctrlTest;
Can anyone help me?