Write a Java program that reads temperature data from the user and displays stat
ID: 441655 • Letter: W
Question
Write a Java program that reads temperature data from the user and displays statistical data about those temperatures. The program will begin by asking the user to enter the name of the location of the readings. (Note: the location may contain spaces and commas.) Create an array of ten doubles. Read in temperature values from the user and store them in the array until -999 is entered or ten values have been entered. Use appropriate prompts to request user input. When done reading temperatures, print a report in the exact format shown below. While printing, use the following methods to determine Celsius, high, low, and average temperatures. I do not even know how to get started please help?Explanation / Answer
Start by importing a Scanner: import java.util.Scanner; then read user input with prompts: Scanner myKeyboard = new Scanner(System.in); System.out.print("Enter location of readings: "); String location = keyboard.next(); System.out.print("Enter temperature values: "); double temp = keyboard.nextDouble(); You can use if-else statements or a for loop to proceed (that would be the most straightforward way).
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.