How do I change the value of users into a word, e.g. when I run the code and input 5 users, it will count down from 5 to 0, but I want to change 5 to five, 4 to four 3 to three etc. I used an if statement if userU == 5 and tried to return it and tried to use it in the println (bot(option)), So I am confused how to do this in java.
Scanner userIn = new Scanner(System.in);
System.out.println("Enter amount");
int userU = userIn.nextInt();
if (userU == 5);
{
String option = "one";
}
while(userU>2){
System.out.println(userU+" users");
System.out.println("There'll be "+(userU-1) + " left");
System.out.println(" ");
userU = userU-1;
}
while(userU>1){
System.out.println(userU+" users left");
System.out.println("There'll be "+(userU-1) + " left");
System.out.println(" ");
userU = userU-1;
}
System.out.println("There'll be "+ (userU-1)+" left.");
System.out.println(" ");