Java netbeans This program will work with arrays which are passed to methods. Th
ID: 3728787 • Letter: J
Question
Java netbeans
This program will work with arrays which are passed to methods. The purpose is to collect data about the high temperatures for a 5 day interval for each of 2 cites. Some statistics will be computed for each city and the temperatures for the 2 cities will be compared.
The first step is to call a method which will get the high temperatures for 5 days in city A. This method will prompt the user the numbers and read them into an array. This array will be returned to the main method.
The second step is to call the same method and have it get the high temperatures for 5 days in city B. This method will return the array to the main method, as before.
The next step is to pass the array for city A to a method which will calculate the average temperature and return it to the main method.
Then, the program will call the same averaging method again to have the average found for the array for city B.
heprogram will then call a method and pass the array for city A and the array for city B to it. The method will compare each of the corresponding temperatures and return the number of days when city A was warmer than city B.
The program will then call a method and pass the array for city B and the array for city A to it. The method will compare each of the corresponding temperatures and return the number of days when city B was warmer than city A.
The main method will pass a string saying “City A”, the array for city A, the average for city A, and the number of times city A was warmer to a method which will display these values to the user.
The main method will pass a string saying “City B”, the array for city B, the average for city B, and the number of times city B was warmer to the above mentioned method which will display these values to the user.
Explanation / Answer
Following is the java code for this program:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.