You need to implement a class called Calculator in a file named /app/solution.py. This class should provide functionality for basic arithmetic operations including addition, subtraction, multiplication, and division.
Requirements:
Class Definition:
Define a class named Calculator.
Methods:
Implement the following methods in the Calculator class:
add(x: float, y: float) -> float: Returns the sum of x and y.
subtract(x: float, y: float) -> float: Returns the result of x minus y.
multiply(x: float, y: float) -> float: Returns the product of x and y.
divide(x: float, y: float) -> float: Returns the result of x divided by y. If y is zero, it should raise a ValueError with the message "Cannot divide by zero".
Data Types:
All parameters (x and y) for the arithmetic methods should be of type float, and the methods should also return a float.
Error Handling:
Specifically handle the division case to raise a ValueError as described above.
You are expected to ensure that the Calculator class meets the above specifications so that it passes the associated test cases derived from the provided test code.