I am working on a java assignment where I have to get BMI with dialog boxes. I keep getting this error "error: illegal start of expression if (BMI = > 18.5 && BMI < 24.9) " Here is the code. Can someone please help!?
import javax.swing.JOptionPane;
public class BodyMassIndex
{
public static void main(String[]args)
{
String input;
double height;
double weight;
double bodyMassIndex = 100;
// Prompt the user for a weight.
input = JOptionPane.showInputDialog("What is your weight ");
weight = Double.parseDouble(input);
// Prompt the user for a height.
input = JOptionPane.showInputDialog("What is your height ");
height = Double.parseDouble(input);
bodyMassIndex = (weight * 703)/(height * height);
// Determine whether the user is Optimal, Under, or Overweight.
if (BMI = > 18.5 && BMI < 24.9)
{
JOptionPane.showMessageDialog(null, "You are Optimal weight " + "Your BMI is " + BMI);
}
else if (BMI < 18.5)
{
JOptionPane.showMessageDialog(null, "You are underweight" + "Your BMI is " + BMI);
}
else
{
JOptionPane.showMessageDialog(null, "You are overweight " + "Your BMI is " + BMI);
}
System.out.println("BodyMassIndex ");
}
}