Ask Question
13 November, 00:31

Write code to assign true to isTeenager if kidAge is 13 to 19 inclusive.

+3
Answers (1)
  1. 13 November, 01:38
    0
    I don't know what language you want it in, but I'll do the few most popular.

    C++:

    int main ()

    {

    int kidAge = 13;

    bool isTeenager = false;

    if (kidAge > = 13 && < = 19)

    {

    isTeenager = true;

    }

    }

    C#:

    namespace OurNameSpace

    {

    class Program

    {

    static void Main (string args[])

    {

    int kidAge = 13;

    bool isTeenager = false;

    if (kidAge > = 13 && isTeenager < = 19)

    {

    isTeenager = true;

    }

    }

    }

    }

    Python:

    kidAge = 13

    isTeenager = 0

    if kidAge > = 13 && kidAge < = 19:

    isTeenager = 1

    Java:

    class Program

    {

    public static void main (String args[])

    {

    int kidAge = 13;

    bool isTeenager = false;

    if (kidAge > = 13 && kidAge < = 19)

    {

    isTeenager = true;

    }

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write code to assign true to isTeenager if kidAge is 13 to 19 inclusive. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers