Ruby codes to calculate simple math problems