Arduino sketch from truth table

But if it's an occupational test to see if the new employee knows boolean concepts, it would at least raise some eyebrows...