I'm new to java programming and I'm having trouble figuring this out.
Here's my code:
boolean running = true;
PANTS:
while (running) {
int waistMeasure = in.nextInt();
if (waistMeasure >= 26 && waistMeasure < 28){
System.out.println("You are a Small.");
break;
}
if (waistMeasure >= 28 && waistMeasure < 30){
System.out.println("You are a Medium.");
break;
}
if (waistMeasure >= 30 && waistMeasure <= 34){
System.out.println("You are a Large.");
break;
}
else {
System.out.println("Invalid input");
}
}
Is there any way to convert this into switch case statements?