Question: Java Instructions You will be given the name of a city followed by a set of integers representing the monthly rainfall in milimeters that have


Instructions You will be given the name of a city followed by a set of integers representing the monthly rainfall in milimeters that have happened in a given area over the past year. You will then calculate the average ( mean) rainfall for the year. The mean is calculated by dividing the sum of the values in the set by the number of elements in the set mean of a set - sum of all elements / number of elements The mean of the series 1, 2, 3, 4, 5 is 1+2+3+4+5/5 - 15/5 - 3 Output will be of the form "The average rainfallin city is mean mm Write the body of the program. Function Details Input The program reads in the following A string the name of a city Twelve integers, representing the monthly rainfall (in millimeters) for the given city over the past year Processing You will calculate the mean rainfall Processing You will calculate the mean rainfall Output Output the following where cryis replaced by the name of the city and mean is replaced by the calculated average integer rainfall The average rainfallin city is mean mm The text must be terminated by a new line character Sample input/output: Sample Input Sample Output Halifax 96 69 97 98 111 108 107 97 100 125 129 118 The average rainfall in Halifax is 105 mm Full Screen Grading 4 POD.java New * CSCI 1110 author Your Name 3 Test Case 1 6. import java.util.; D Nolnun 8. public class POD { Test Case 2 Not run public static void main(String[] args) { //PLEASE START YOUR WORK HERE Test Case 3 Test Case 4 //PLEASE END YOUR WORK HERE System.out.print("END OF OUTPUT"); 19
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
