new mutator method that lets the user enter a number...
...but the method should check wether number is the first or the second in the calculation. This is done based on the previous action by the user - if it was a choice of calculation, the number entered is of course the second number. With no previous action by the user, the number is therefor the first number in the calculation.
In the field, we were to create a logical field keeping track of if the next number entered is the first or the second number in the calculation. Im pretty sure that I need to involve this in the new mutator method.
At the same time we were to make a a toString method changing a real number to string a string object shown with two decimals. Also very certain I need to include this in the new method.
The last field is the logical
This is the toString method
public Calculator(int _firstNumber, int _secondNumber, char operatorChar, boolean _ctrlTest)
// initialise instance variables
_firstNumber = firstNumber;
_secondNumber = secondNumber;
operatorChar = " ";
_ctrlTest = ctrlTest;
some code left out
public String toString()
DecimalFormat df = new DecimalFormat("#.##");
Im really without clues, so could you hint me away?