diff --git a/src/main/java/com/houarizegai/calculator/ui/CalculatorUI.java b/src/main/java/com/houarizegai/calculator/ui/CalculatorUI.java index d02f228b..49550fd3 100644 --- a/src/main/java/com/houarizegai/calculator/ui/CalculatorUI.java +++ b/src/main/java/com/houarizegai/calculator/ui/CalculatorUI.java @@ -81,6 +81,15 @@ public CalculatorUI() { window.setVisible(true); } + /** + * Performs a mathematical operation on two numbers based on the given operator. + * + * @param firstNumber The first operand for the mathematical operation. + * @param secondNumber The second operand for the mathematical operation. + * @param operator The operator specifying the type of mathematical operation to be performed. + * Valid operators are '+', '-', '*', '/', '%', '^'. + * @return The result of the mathematical operation. + */ public double calculate(double firstNumber, double secondNumber, char operator) { switch (operator) { case '+':