|
|
@ -5,9 +5,9 @@ import java.util.Scanner;
|
|
|
|
public class NewCalcEngine {
|
|
|
|
public class NewCalcEngine {
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
// performCalculations();
|
|
|
|
performCalculations();
|
|
|
|
// executeCalculations();
|
|
|
|
executeCalculations();
|
|
|
|
// executeInteractively();
|
|
|
|
executeInteractively();
|
|
|
|
dynamicInteractivity();
|
|
|
|
dynamicInteractivity();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -78,14 +78,6 @@ public class NewCalcEngine {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void doCalculation(CalculateBase calculate, double leftVal, double rightVal) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
calculate.setLeftVal(leftVal);
|
|
|
|
|
|
|
|
calculate.setRightVal(rightVal);
|
|
|
|
|
|
|
|
calculate.calculate();
|
|
|
|
|
|
|
|
System.out.println("The result of the calculation is: " + calculate.getResult());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void performCalculations() {
|
|
|
|
private static void performCalculations() {
|
|
|
|
|
|
|
|
|
|
|
|
MathEquation[] mathEquation = new MathEquation[4];
|
|
|
|
MathEquation[] mathEquation = new MathEquation[4];
|
|
|
|