if
Write an algorithm to determine if a person is teenager or an adult
Answers
Answered by
1
Answer: Following is a java class to determine whether a person is adult or teenager or neither.
class Age {
String checkAge(int age) {
if (age>=18)
return "The person is an adult.";
else if (age >=13 && age<18)
return "The person is a teenager."
else
return "The person is neither a teenager nor an adult.";
}
}
Please mark it as Brainliest.
Similar questions