When I try to run this code, it won't let me use "bmi". I'm trying to make a simple Body Mass Index calculator, but I don't understand why it won't work. If you could rewrite the code properly, it'd help me learn better.
import java.util.Scanner;
public class Bmi {
int weight;
int height;
int bmi = weight /(height*height) * 703;
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter weight: ");
int weight = input.nextInt();
System.out.print("Enter height: ");
int height = input.nextInt();
System.out.println(bmi);
}
}