Ask Question
19 February, 03:23

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

+2
Answers (1)
  1. 19 February, 04: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?
Find an answer to your question ✅ “Write code to assign true to isTeenager if kidAge is 13 to 19 inclusive. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers