Ask Question

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

+4
Answers (1)
  1. 20 April, 20:48
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers