How do I do this program?

Ahhh, we only want x to be added 1 if, and only if the conditions are met!... I think