Question: Need this source code translated into a flowchart diagram. I already have the code and it is provided below. Need to translate into a flowchart
Need this source code translated into a flowchart diagram. I already have the code and it is provided below. Need to translate into a flowchart diagram
Here is the source code:
public class WindChillTemperature { // wind chill temperature class
public static void main(String[] args) { // main method required for running java program Scanner input = new Scanner(System.in); //scanner object created for receiving user input DecimalFormat precision = new DecimalFormat("0.00000"); //decimal format object for precision
double ws = 0.0, temperature = 0.0; // ws for receiving wind speed input, temperature for receiving temp input by user double windChill; String degree = "\u00b0"; // string object representing degree symbol System.out.print("Enter the temperature in Farenheit between -58"+ degree +" and 41"+ degree +": " );//prompt for temperature input temperature = input.nextDouble(); // accept temperature from keyboard while ((temperature < -58) || (temperature > 41)) { System.out.print("Temperature must be between -58 and 41: "); temperature = input.nextDouble(); //loop to validate that input is within valid range } System.out.println(); System.out.print("Enter the wind speed (>=2) in miles per hour: "); //prompt user for wind speed ws = input.nextDouble(); while (ws < 2) { //validate user input to make sure entered value is not less than 2 System.out.print("Wind speed must above 2 degree: "); ws = input.nextDouble(); } windChill = 35.74 + 0.6215 * temperature - 35.75 * Math.pow(ws, 0.16) + 0.4275 * temperature * Math.pow(ws, 0.16);
System.out.println(); System.out.print("The wind chill index is "+ precision.format(windChill)); //display the wind chill input.close(); //close scanner object
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
