title: Simple way to limit the output to a certain integer without using if/else statements?
body: <p>I have an assignment where I need to calculate grades. The block of code below takes the user inputted "sections" and multiplies it by 4, while limiting the total output to 20. According to the assignment, we can't use if/else statements, but that's all I can think of to limit the output to 20. Perhaps using a simple Math method? But I can't think of a simple way to do this.  </p>
  
  <pre><code> public static int calcDGrade(int sections) //method to calculate the grade for the students sections
  {
        int maxDGrade = ((sections*4)); 
  
        if (maxDGrade &gt; 20) //limits total score to 20
  
              {
                   return 20;
              } 
        else 
              { 
                   return maxDGrade;
              }
  
  }
  </code></pre>