diff --git a/calculator.py b/calculator.py new file mode 100644 index 0000000..a64607a --- /dev/null +++ b/calculator.py @@ -0,0 +1,20 @@ + +class Calculator: + def add(self, a, b): + # No type checking or validation + return a + b + + def subtract(self, a, b): + # Could use better error handling + return a - b + + def multiply(self, a, b): + # Missing docstring and input validation + return a * b + + def divide(self, a, b): + # Basic division without proper error handling + return a / b + +# Global instance - potential improvement area +calculator = Calculator() diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..865a2c1 --- /dev/null +++ b/utils.py @@ -0,0 +1,17 @@ + +def validate_number(num): + # Basic validation without proper type checking + try: + float(num) + return True + except: + return False + +def format_result(result): + # Simple formatting without proper rounding or precision handling + return str(result) + +def parse_input(input_str): + # Basic parsing without proper error handling + parts = input_str.split() + return float(parts[0]), parts[1], float(parts[2])