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

How cold is it outside? The temperature alone is not enough to provide the answe

ID: 3746534 • Letter: H

Question

How cold is it outside? The temperature alone is not enough to provide the answer. Other factors including wind speed, relative humidity, and sunshine play important roles in determining coldness outside. In 2001, the National Weather Service (Nws) implemented the new wind-chill temperature to measure the coldness using temperature and wind speed. The formula is: tuse 3.74+0.6215ta - 35.75v0.16 +0.4275t.v0.16 Correction: The first number in this equation should b 35.74 where to is the outside temperature measured in degrees Fahrenheit, v is the speed measured in miles per hour, and twe is the wind-chill temperature. The formula cannot be used for wind speeds below 2mph or temperatures below -58°F or above 41°F. Write a program that prompts the user to enter a temperature between-58°F and 41°F and a wind speed greater than or equal to 2 then displays the wind-chill temperature. Use Math.pow(a, b) to compute vo.16. Your class must be named windchil1. Here is a sample run: Enter a temperature between -58°F and 41°F: 5.3 Enter the wind speed 2) in miles per hour: 6 The wind chill index is -5.567068455881625 Hint: the degree symbol has Unicode value ueobe At this point, you can't actually test if the numbers are out of the desired range. Don't worry about it; if someone enters invalid data, it's their problem. When you finish, upload your file Windchill.java

Explanation / Answer

import java.util.Scanner; public class WindChill { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter a temperature between -58u00b0F and 41u00b0F: "); double t = in.nextDouble(); System.out.print("Enter the wind speed (>= 2) in miles per hour: "); double v = in.nextDouble(); double wcf = 35.74 + 0.6215*t - 35.75*Math.pow(v, 0.16) + 0.4275*t*Math.pow(v, 0.16); System.out.println("The wind chill index is " + wcf); } }

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