Time to combine what you know. Write a program that takes an int age variable and prints the correct category:
int age = 25;
if (age < 0) {
System.out.println("Invalid age");
} else if (age < 13) {
System.out.println("Child");
} else if (age < 18) {
System.out.println("Teenager");
} else if (age < 65) {
System.out.println("Adult");
} else {
System.out.println("Senior");
}
Notice the order. You check the smallest range first and work upward. If you checked age < 65 before age < 13, a -year-old would be classified as "Adult".
Try modifying this. Add a "Toddler" category for ages under . Think about where that new condition goes in the chain.