title: How to write a method in Java that averages six positve integers?
body: <p>The method  should average six POSITIVE integers. Integers which are negative or zero should not be included in the average. If all the numbers are invalid return -1. Is there anyway to shorten this code?</p>
  
  <pre><code>public float averageSix( int a, int b, int c, int d, int e, int f ) {
   if( a &lt; 0 ) { a = 0; }
   if( b &lt; 0 ) { b = 0; }
   if( c &lt; 0 ) { c = 0; }
   if( d &lt; 0 ) { d = 0; }
   if( e &lt; 0 ) { e = 0; }
   if( f &lt; 0 ) { f = 0; }
    float aver = ( ( a + b + c + d + e + f ) / ( ( a / a ) + ( b / b ) 
     + ( c / c ) + ( d / d ) + ( e / e ) + ( f / f ) ) );
   if( aver = 0 ) { aver = -1; }
    return aver;
  }
  </code></pre>