a tip calculator with error handling