Skip to content

Commit 9199b85

Browse files
committed
refactor: reset variable names that don't fit naming
1 parent ef52572 commit 9199b85

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/calculator/Calculator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ public void calculation(){
1515
public void OperatorSetting(ArithmeticExpressionStack arithmeticExpressionStack) {
1616
ErrorException exception = new ErrorException();
1717
String firstString = arithmeticExpressionStack.pop();
18-
int firstNumber = exception.NumericalError(firstString);
18+
int cumulativeResult = exception.NumericalError(firstString);
1919

2020
for(int i = 0; i<(arithmeticExpressionStack.getStackSize())/2;i++){
2121
String operator = arithmeticExpressionStack.pop();
2222
String secondString = arithmeticExpressionStack.pop();
2323
int secondNumber = exception.NumericalError(secondString);
24-
firstNumber = chooseOperatorAndCalculate(firstNumber, operator, secondNumber);
24+
cumulativeResult = chooseOperatorAndCalculate(cumulativeResult, operator, secondNumber);
2525
}
2626

27-
if(firstNumber != 0){
28-
message.calculationResult(firstNumber);
27+
if(cumulativeResult != 0){
28+
message.calculationResult(cumulativeResult);
2929
}
3030
init();
3131
}

0 commit comments

Comments
 (0)