Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A) Write the prototype for a function named isTeenager . The function should hav

ID: 3816124 • Letter: A

Question

A) Write the prototype for a function named isTeenager. The function should have an integer parameter named age. When isTeenager is called, it should return a boolean to indicate that the given age is in the "teenage range". Just write the prototype for this portion of the question.

B) Implement a function named isTeenager. The function should have an integer parameter named age. when isTeenager is called, it should return a boolean to indicate that the given age is in the "teenage range". Specifically the function should return true if the given age is between 13 and 19 (inclusive) and it should return false otherwise.

Explanation / Answer

Here is the prototype and the implementation in C++ for you:

#include <iostream>
//isTeenager prototype.
bool isTeenager(int);

//isTeenager implementation.
bool isTeenager(int age)
{
    return age >= 13 && age < 20;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote