Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. public void busiesthour()
  2.     {
  3.         for (int hour=0; hour>hourCounts.length; hour++){
  4.             if(hourCounts[hour]>hourCounts[hour-1]){
  5.                 //if value is bigger than last value set it equal to local max.
  6.                 int localMax = hourCounts[hour];
  7.                 //if next value in array is greater than localMax, set this to localMax
  8.                 if(hourCounts[hour] > localMax) {
  9.                     localMax = hourCounts[hour];
  10.                 }
  11.  
  12.                 System.out.println(localMax);
  13.                 }
  14.             }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement