Solution for interest calculator