Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Weather {
- private int[][] theArray;
- public Weather(int[][] array) {
- array = theArray;
- }
- public int countHotDays(){
- int hot = 0;
- for (int row=0; row < theArray.length; row++)
- {
- for (int col=0; col < theArray[row].length; col++)
- {
- int value = theArray[row][col];
- if(value > 100)
- hot++;
- }
- }
- return hot;
- }
- public int last() {
- int[] lastRow = theArray[theArray.length - 1];
- int lastItem = lastRow[lastRow.length - 1];
- return lastItem;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement