Hello,
I just started a computer science course and I'm having issues with one of the assignments. I think for the most part, I've got it done correctly (although, I'm a little shaky with the if/else if statements), but I'm having a syntax problem on lines 15 and 19 ("illegal start of expression").
I'd really appreciate if someone could take a look over and let me know what they think.
/**Program objective is to calculate the Wind Chill Index.
The program is meant to display error messages when the user
inputs a temperature not within the range of -58 to 41 and a WindSpeed
below 2*/
import java.util.Scanner;
public class Assignment2
{
public static void main(String[] args)
{
double outsideTemperature, windSpeed, windChillTemp;
double velocity = Math.pow(windSpeed, 0.16);
double windChillTemp = 35.74 + 0.6215 * outsideTemperature - 35.75 * velocity + 0.4275 * outsideTemperature * velocity;
Scanner input = new Scanner (System.in);
/**Program prompts user to enter value for "outsideTemperature*/
System.out.print("Enter the Temperature in Fahrenheit: ");
outsideTemperature = input.nextDouble();
/**If the outside temperature entered is less than -58 or greater than 41 the program will display an error message*/
if (outsideTemperature < -58 || > 41)
{
System.out.print("Please enter a temperature between -58F and 41F");
}
/** If the temperature entered is greater or equal to -58 and less than 41, the program will continue*/
else if (outsideTemperature >= -58 || <= 41)
/**Program prompts user to enter value for the Wind Speed*/
{
System.out.print("Enter the Wind Speed in miles per hour: ");
windSpeed = input.nextDouble();
}
/**If the wind speed entered is less than 2, the program will display an error message */
if (windSpeed < 2)
{
System.out.print("Please enter a Wind Speed greater than 2MPH");
}
/**If the wind speed is greater than 2 the program will continue*/
else if (windSpeed >= 2)
{
/**Program calculates Wind Chill Index and displays the result*/
System.out.print("The Wind Chill index is: " + "windChillTemp");
}
}
}
Thanks!