Frustrating Fruit

If you are wearing:
 
A HAT
 
If the customer asks for an APPLE,
give them a banana and take off your hat.
If the customer asks for a BANANA,
give them a banana.
No HAT
If the customer asks for an APPLE,
give them an apple and put on your hat.
If the customer asks for a BANANA,
give them a banana.