Skip to content

Commit b6d6340

Browse files
authored
Merge pull request biforest#2 from oereo/fix/java-calculator
refactor: delete unused class and fix naming
2 parents f53fdf9 + 860bcd7 commit b6d6340

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/main/java/calculator/Calculator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ public void calculation(){
1313
}
1414

1515
public void OperatorSetting(ArithmeticExpressionStack arithmeticExpressionStack) {
16-
ErrorException exception = new ErrorException();
16+
ErrorException exceptionCheck = new ErrorException();
1717
String firstString = arithmeticExpressionStack.pop();
18-
int firstNumber = exception.NumericalError(firstString);
18+
int cumulativeResult = exceptionCheck.NumericalError(firstString);
1919

2020
for(int i = 0; i<(arithmeticExpressionStack.getStackSize())/2;i++){
2121
String operator = arithmeticExpressionStack.pop();
2222
String secondString = arithmeticExpressionStack.pop();
23-
int secondNumber = exception.NumericalError(secondString);
24-
firstNumber = chooseOperatorAndCalculate(firstNumber, operator, secondNumber);
23+
int secondNumber = exceptionCheck.NumericalError(secondString);
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
}

src/main/java/calculator/InputUserData.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)