Sales Tax problem (assignment for a company interview)