Write a program that prompts the user for their age and determines if they are a teenager. Someone is a teenager if their age is greater than or equal to 13 and less than or equal to 19. Your program should be able to produce the following result: What is your age? 13 Yes, you are a teenager. What is your age? 17 Yes, you are a teenager. What is your age? 20 No, you are not a teenager. Hint: you must print either "yes" or "no" in your output.
function start(){ var age = readInt("Age: "); if(age == 20){ println("Yes, you are a teenager."); }else{ println("No, you are not a teenager.") }
if
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)