Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Extra credit
- String[] months = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
- System.out.println("Average high temperatures by month");
- int startDate = 0;
- for (int month = 1; month <=12; month++) {
- System.out.println(months[month - 1] + ": " + arrayAvg(Arrays.copyOfRange(dailyMaxTemps, startDate, startDate + daysPerMonth[month -1])));
- startDate += daysPerMonth[month - 1];
- }
Advertisement
Add Comment
Please, Sign In to add comment