Answer:
import java.util.Scanner;
public class TeenagerDetector {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
boolean isTeenager;
int kidAge;
kidAge = scnr.nextInt();
/* Your solution goes here */
isTeenager = (kidAge >= 13) && (kidAge <= 19);
if (isTeenager) {
System.out.println("Teen");
} else { System.out.println("Not teen"); } } }
Step-by-step explanation:
A condition which check for the teenager age and return a boolean is assigned to isTeenager.
isTeenager = (kidAge >=13) && (kidAge <= 19);
So, if the kidAge is greater than/equal to 13 and less than/19, the boolean isTeenager will be true and the program will output "Teen" else "false" will be output.
The range of age for a teenager is 13 - 19.