title: Converting 24 format to 12 format with updateDisplay()
body: <p>I was asked to only used the updateDisplay() method to change the format for the hour in this clockDisplay, eveythings works perfectly the hour can get to 12:59PM and use the method timeTick() it gets to 1:00PM but after using timeTick() again it goes to 1:01AM again. How can i fix this problem? </p>
  
  <pre><code>public class ClockDisplay
  {
      private NumberDisplay hours;
      private NumberDisplay minutes;
      private String displayString;   
  
      public ClockDisplay()
      {
          hours = new NumberDisplay(24);
          minutes = new NumberDisplay(60);
          updateDisplay();
      }
  
      public ClockDisplay(int hour, int minute)
      {
          hours = new NumberDisplay(24);
          minutes = new NumberDisplay(60);
          setTime(hour, minute);
      }
  
      public void timeTick()
      {
          minutes.increment();
          if(minutes.getValue() == 0) {  // it just rolled over!
              hours.increment();
          }
          updateDisplay();
      }
  
      public void setTime(int hour, int minute)
      {
          hours.setValue(hour);
          minutes.setValue(minute);
          updateDisplay();
      }
  
      public String getTime()
      {
          return displayString;
      }    
  
      private void updateDisplay()
      {
          int h = hours.getValue()%12;
          String format = (hours.getValue()/12 == 0 ? "AM":"PM");
          if(h == 0)
          {
              h = 12;
          }
          else if(hours.getValue() &gt; 12)
          {
              hours.setValue(hours.getValue() - 12);
          }
          displayString = hours.getDisplayValue() + ":" + 
          minutes.getDisplayValue() + format;
      }
  }
  </code></pre>