Java CodingBat Logic teaParty?
<p>I am obviously missing an "if" statement but I am not sure how to cover if tea or candy is not double of each other: </p>

<p>Here is the code I have so far:</p>

<p>Given three ints, a b c, return true if they are in strict increasing order, such as 2 5 11, or 5 6 7, but not 6 5 7 or 5 5 7. However, with the exception that if "equalOk" is true, equality is allowed, such as 5 5 7 or 5 5 5. </p>

<pre><code>inOrderEqual(2, 5, 11, false) → true
inOrderEqual(5, 7, 6, false) → false
inOrderEqual(5, 5, 7, true) → true




public int teaParty(int tea, int candy) {

  if(tea &lt; 5 || candy &lt; 5)
     return 0;

  if(tea == 5 &amp;&amp; candy == 5)
     return 1;

  if(tea != 5 &amp;&amp; candy != 5)
     return 1;

  if(candy * 2 &gt;= tea)
     return 2;

  if(tea * 2 &gt;= candy)
     return 2;


return 0;
}
</code></pre>

<p>These are the errors I am receiving:</p>

<pre><code>Expected    This Run        
teaParty(6, 8) → 1  1   OK      
teaParty(3, 8) → 0  0   OK      
teaParty(20, 6) → 2 1   X       
teaParty(12, 6) → 2 1   X       
teaParty(11, 6) → 1 1   OK      
teaParty(11, 4) → 0 0   OK      
teaParty(4, 5) → 0  0   OK      
teaParty(5, 5) → 1  1   OK      
teaParty(6, 6) → 1  1   OK      
teaParty(5, 10) → 2 2   OK      
teaParty(5, 9) → 1  2   X       
teaParty(10, 4) → 0 0   OK      
teaParty(10, 20) → 2    1   X       
other tests
X       
</code></pre>
