Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Rewrite this program using and ArrayList. Assume that while entering temperature

ID: 3655674 • Letter: R

Question

Rewrite this program using and ArrayList. Assume that while entering temperatures from the keyboard -100 is the stopping condition. In other words, read temperatures from the keyboard until -100 temperature is entered. import java.util.Scanner; public class temp{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); double[] tempereture = new double[31]; for(int i=0; i < tempereture.length ; i++) tempereture[i] = scan.nextDouble(); int maxIndex = 0; for(int i=0; i < tempereture.length ; i++) { if(temperature[i] > temperature[maxIndex]) maxIndex = i; } System.out.println("heighest temperature is " + temperature[maxIndex]); }}

Explanation / Answer

1) Average: int totalTemp = 0; int average = 0; for (int i=0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote