From 3d97bab81529a39e595f0104723ea2fac7c2c317 Mon Sep 17 00:00:00 2001 From: xinri Date: Sun, 9 Nov 2025 23:49:10 +0100 Subject: [PATCH] add the design.md for the calculator-conundrum --- .../concept/calculator-conundrum/.meta/design.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/exercises/concept/calculator-conundrum/.meta/design.md b/exercises/concept/calculator-conundrum/.meta/design.md index 5163b002c..5134eb08a 100644 --- a/exercises/concept/calculator-conundrum/.meta/design.md +++ b/exercises/concept/calculator-conundrum/.meta/design.md @@ -18,3 +18,15 @@ - `conditionals-if`: know how to do conditional logic. - `switch-statement`: know how to work with a `switch` statement. + +## Analyzer + +This exercise could benefit from the following rules in the [analyzer]: + +- `essential`: Verify that the solution is using the try catch statement for the division. +- `actionable`: If the solution is wrapping all the code in a try catch statement, instruct the student to only use the `try catch` for the division statement +- `actionable`: If the solution uses only `if` statement, instruct the student that he/she can use the `switch case` statement to perform the operations. +- `informative`: If the solution does not throw the exception for `Operation cannot be null` and `Operation cannot be empty` at the beginning, suggest the fail-fast approach to the student. + Inform this way of implementation can be less error-prone and more readable as suggested by Martin Fowler: + +[analyzer]: https://github.com/exercism/java-analyzer