Question: What am i doing wrong here? its making me hit enter twice, im trying to loop this if they do not choose between 1-7 public
What am i doing wrong here? its making me hit enter twice, im trying to loop this if they do not choose between 1-7
public static int getNumber()
{
int totalCats = 7;
System.out.println("Enter the number of cats you want adopted: ");
totalCats = get.nextInt();
while(totalCats >= 7 )
{
System.out.println("We have a max of " + totalCats + " available for adoption" + " Please choose an amount between 1 and 7:");
totalCats = get.nextInt();
}
return totalCats;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
