title: Java - using int values to calculate average (a decimal value) using proper casting methods
body: <p>So this is a basic question, I have 2 <code>int</code> variables or field as it is called in Java. One is total score the other is game rounds. I am using <code>double</code> which takes decimal numbers as the data type for <code>average</code> variable.  But I'm not getting the correct result.</p>
  
  <pre><code>int totalScore = 75;
  int gameRounds = 2;
  
  public void calculateAverage() {
      double average = totalScore / gameRounds;
      System.out.println(average);
  
  }
  </code></pre>
  
  <p>The result is: <code>37.0</code>, why isn't it the result 37.5, even though I'm using the correct datatype? </p>