Respuesta :

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;
             }
       }
}

Answer:

For assigning true to isTeenager if the kid age is 13 and 19 inclusive, first declare the boolean variable for storing true/ false. After that, assign 13 to kidAge variable. Now, provide the necessary condition for kid age is 13 and 19 inclusive. Finally, print the result under the if-else statement.

Further explanation:

Following is the C program to assign true if kid age is 13 and 19 inclusive.

Code:

#include <stdio.h>

#include <conio.h>

#include <stdbool.h>

int main(void)

{

//boolean variable declaration for true/false

bool isTeenager;

// variable declaration to store the age of kid

int kidAge;

kidAge = 13;

// condition for kid age is 13 and 19 inclusive

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

isTeenager = true;

}

// if else statement to print the output

if (isTeenager) {

printf("The kid is a teenager\n");

}

else {

printf("The kid is not a teenager\n");

}

return 0;

}

Learn more:

1. A company that allows you to license software monthly to use online is an example of ? brainly.com/question/10410011  

2. Prediction accuracy of a neural network depends on _______________ and ______________. brainly.com/question/10599832  

3. The shape of our galaxy was determined ‘on the inside looking out' by surveying the milky way using ____________ telescopes. brainly.com/question/7866623  

4. List 3 characteristics of the ideal encryption scheme. brainly.com/question/3000161  

Answer details:

Grade: Senior Secondary School

Subject: Programming Language

Chapter: C Language

Keyword:

C Language, C++ language, JAVA, python, if else statement, assign, true, teenager, kidAge, 13, 19, inclusive, Boolean, variable, function, print, condition, true, false, return

ACCESS MORE
EDU ACCESS
Universidad de Mexico