So basically, i have a method that i had to write that calculates windchill based on the parameters of temp and velocity(as doubles). They seem like there is no use for them, as they are just getting in the way of the ability to properly call the method.
I ask because this is how we are told to write this at the moment..it just seems like wasteful coding to me.
purple colored variables are the ones in question
Code
public class WindChill {
public static void main(String[] args) {
double temp, velocity, windChill;
[COLOR=purple] temp = 33;
velocity = 45;[/COLOR]
windChill = calculateWindChill(33, 45);
System.out.println("The wind chill for temperature (degrees f) = " +temp+ " and wind velocity (MPH) " +velocity+ " is " +windChill+ " degrees Fahrenheit" );
}
public static double calculateWindChill(double temp, double velocity) {
double windChill = 35.74 + 0.6215*temp - 35.75*Math.pow(velocity,0.16) + 0.4275*temp* Math.pow(velocity, 0.16);
return windChill;
}
}
Thanks for any answers =)