3 way calculation
<p>I have a data object with three fields, A, B and C. The problem is that the user can set any of them because:</p>

<p>A * B = C</p>

<p>So if a user starts off by setting A &amp; B, C will be calculated.  but then if a user set C, A gets recalculated, so there is an implicit anchoring that is happening based off the last field that the user set.</p>

<p>i want to avoid a solution with a lot of flag member variables.  Any best practices on how i can code this class up without having a lot of stuff  like this below</p>

<pre><code>public class Object
{
     private double _A;
     private double _B;
     private double _C;

     private bool _enteredA;
     private bool _enteredB;
     private bool _enteredC;

public double A
{
get
    {
     if (_enteredC)
     {
          return _C / _B;
     }
     else
     {
        return _A;
     }
  }
}
</code></pre>

<p>should the logic of setting A, B, and C always be on the "get" or the "set".</p>

<p>Is there any cleaner way to doing this?</p>
