The attached has two approaches - the first one using rules on A and B, the second one using a default (based off this approach: https://docs.microsoft.com/en-us/archive/blogs/infopath/conditional-default-values) on the Result field. Right click the attached file, save locally, right click the local file and select design. Then you can preview, take a look at the rules, etc. :)
Hilary Stoupa
