Programming exercise?
<p><strong>I got this exercise, is not a homework</strong>, I just trying to solve:</p>

<blockquote>
  <p>We manage a farm with horses that have
  to work on the field.</p>
  
  <p>A horse has</p>
  
  <ul>
  <li>a name,</li>
  <li>a maximum amount of
  working hours per week,</li>
  <li>the amount
  of hours actually worked and</li>
  <li>a field to indicate if she is lazy or
  hard-working.</li>
  </ul>
  
  <p>All the attributes of the Horse class
  are private and they have no setters.
  Initial values are passed through the
  constructor.</p>
  
  <p>The Horse class has a method to add
  one hour of actual work. That method
  is called every hour (that the horse
  works). At the begin of the next week,
  we reset that counter to 0, by calling
  another method taking no parameter.</p>
  
  <p>A lazy horse cannot work more than 34
  hours/week, while a hard-working horse
  can work up to 80 hours.</p>
  
  <p>Code a Horse class that is shielded
  against wrong working hours data.</p>
  
  <p>Your main method will create an horse
  and call its methods, but the data
  must never be corrupted, ie. the
  working hour limits must be respected.
  For example, a lazy horse's maximum
  hours cannot be set above 34 and the
  number of hours worked cannot be
  greater than the maximum.</p>
  
  <p>If the Horse class detects an attempts
  to set incorrect data, the data
  remains unchanged (and you print a
  message to help you debugging).</p>
</blockquote>

<p>Example of correct data:</p>

<pre><code>Name: "Blacky" 
lazy: no
max hours / week = 70
actual hours this week = 61

Name: "Sultan" 
lazy: yes
max hours / week = 30
actual hours this week = 1
</code></pre>

<p>Example of corrupted data (your code should make such a situation impossible to reach)</p>

<pre><code>Name: "Georges" 
lazy: yes
max hours / week = 50 (wrong because lazy horses work max 34h/week)
actual hours this week = 51 (wrong because 51 &gt; 50).
</code></pre>

<p>This is my code:</p>

<pre><code>public class Horse {

    private String name;
    private int maximumAmount;
    private int amountWorked;
    private boolean isLazy;

    public Horse(String name, int maximumAmount, int amountWorked, boolean lasyOrHardworking) {
        this.name = name;
        this.maximumAmount = maximumAmount;
        this.amountWorked = amountWorked;
        this.isLazy = lasyOrHardworking;
    }

    void everyHour(){
        amountWorked = amountWorked + 1;
        System.out.println(amountWorked);

        if((isLazy == true)&amp;&amp;(amountWorked &lt;= 34)){
            resetToZero();
        }
        if((isLazy == false)&amp;&amp;(amountWorked &lt;= 80)){
            resetToZero();
        }
    }

    void resetToZero(){
        this.amountWorked = 0;
    }
}
</code></pre>

<p>and my main class</p>

<pre><code>public class MainHorse {
    public static void main(String args[]){
        Horse one = new Horse("Blacky", 34,35,true);
        one.everyHour();
    }
}
</code></pre>

<p><strong>my question is how can I get that my method everyhour do the reset method, and in general, what is wrong in my code?</strong></p>

<p>I hoper you can help me</p>
