just needs a responds We could use an array to create a program that documents t
ID: 3657385 • Letter: J
Question
just needs a responds We could use an array to create a program that documents the temperatures every hour throughout a 24 hour period for each week of a month. This would allow the user to see the correlation between temperatures between the days and nights. Also looking to see the increase or decrease of temperatures as we move into either summer or winter. You can change the data you input in an array once the program is made. For example if you use the above example for temperatures for the first month, then the next month you can change the data and use the same array for calculating the average wind speed for each hour within a day. The cons would be if you have to many indexes it could be difficult to maintain.Explanation / Answer
public class Temperature { public static void main(String[] args) { Scanner console = new Scanner(System.in); // Input the number of days from the user. System.out.print("How many days' temperatures? "); int days = console.nextInt( ); // Declare an array, maybe should check if days is positive int[ ] temps = new int[days]; // Input and store the temperatures in the array for (int i = 0; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.