120k views
5 votes
Design and create a GUI program for a meteorologist in Java that calculates the wind chill factor and cloud base altitude for inputs of temperature in Fahrenheit, wind speed in mph, and the dew point in Fahrenheit. The inputs can be entered from the keyboard or read from a file for multiple calculations. When the program begins, a window with three (3) buttons will allow the user to: Create Account, Login, or Cancel. Accounts require a user name and password with at least 9 characters including at least one uppercase letter, lowercase letter, and digit. After successful Login, the main GUI will be displayed and have data entry and selection controls.

User Chaosguru
by
5.0k points

1 Answer

3 votes

Answer:

/******************************************************************************

* Compilation: javac WindChill.java

* Execution: java WindChill t v

*

* Given the temperature t (in Fahrenheit) and the wind speed v

* (in miles per hour), compute the wind chill w using the formula

* from the National Weather Service.

*

* w = 35.74 + 0.6215*t + (0.4275*t - 35.75) * v ^ 0.16

*

******************************************************************************/

public class WindChill {

public static void main(String[] args) {

double t = Double.parseDouble(args[0]);

double v = Double.parseDouble(args[1]);

double w = 35.74 + 0.6215*t + (0.4275*t - 35.75) * Math.pow(v, 0.16);

System.out.println("Temperature = " + t);

System.out.println("Wind speed = " + v);

System.out.println("Wind chill = " + w);

}

}

Step-by-step explanation:

User Keith Brewster
by
5.0k points