Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1.  
  2. public class Weather {
  3.  
  4. private int[][] theArray;
  5. public Weather(int[][] array) {
  6. array = theArray;
  7. }
  8.  
  9. public int countHotDays(){
  10. int hot = 0;
  11. for (int row=0; row < theArray.length; row++)
  12. {
  13. for (int col=0; col < theArray[row].length; col++)
  14. {
  15. int value = theArray[row][col];
  16. if(value > 100)
  17. hot++;
  18. }
  19. }
  20. return hot;
  21. }
  22.  
  23. public int last() {
  24. int[] lastRow = theArray[theArray.length - 1];
  25. int lastItem = lastRow[lastRow.length - 1];
  26. return lastItem;
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement