Count the number of times a variable's value is added
<p>So the question asks me to do the following: </p>

<pre><code>public boolean addRating(int rating)
</code></pre>

<blockquote>
  <p>Add a rating for the video. If rating is between 1-5 inclusive, then
  update the ratings for this video, keeping track of how many ratings
  for it have been received, and return true. Otherwise, print out an
  error message and return false.</p>
</blockquote>

<p>And this is what I managed to do: </p>

<pre><code>   public class Video {

    private int rating;

    public boolean addRating(int rating){
        this.rating = rating;
        boolean result;
        int newRating = rating;
        if(newRating&gt;=1 &amp;&amp; newRating &lt;=5){
            rating = newRating;
            result = true;
        }
        else{
            System.out.println("ERROR!");
            result = false;
        }
        return result;
    }
</code></pre>

<p>So my question is how exactly do I count the number of times a video is rated?</p>
