When I try to write "BMI" in the scanner, it doesn't even let me, it is just being stuck and I can't write anything after the println (I wrote down where it is)
import java.util.*;
public class Q1
{
static Scanner scan = new Scanner(System.in);
public static void main(String[] args)
{
System.out.println("Hello, welcome to Clalit!");
System.out.println("Login to view more options (Reply with 'Ok' below to login)");
String ok = scan.next();
ok = ok.toLowerCase();
if (ok.equals("ok")){
System.out.println("Hello, please insert your Username");
String name = scan.next();
name = name.toLowerCase();
if (name.equals("galaxy")){
System.out.println("Hello, please insert your Password");
int pass = scan.nextInt();
if (pass == 12341234){
System.out.println("Welcome to Clalit, what would you like to do?");
System.out.println("BMI/My_details/KG_to_POUNDS");
//Here when you write BMI for exmaple it just being stuck and you can't write anymore
String play = scan.nextLine();
play = play.toLowerCase();
if (play.equals("bmi")){
System.out.println("Enter Your Height");
double Height = scan.nextDouble();
System.out.println("Enter Your Weight");
double Weight = scan.nextDouble();
double BMI = Weight / (Height * Height);
System.out.println("Your BMI is " + BMI);
}
}else{
System.out.println("Wrong password, kicked");
}
}else {
System.out.print("You're not welcomed!");
}
}
}
}