String calculator code sample