1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sergeeva-Olga [200]
3 years ago
10

C programming:

Computers and Technology
1 answer:
mixas84 [53]3 years ago
8 0
IsTeenager = ( ( kidAge >= 13 ) && ( kidAge <= 19 ) ) ? true : false;

Another way:

if( ( kidAge >= 13 ) && ( kidAge <= 19 ) )
  isTeenager = true;
else
   isTeenager = false;
You might be interested in
What doyou mean by process model and project model?
vlabodo [156]

Answer:

A process model is a narrative of each type of process. These models consist of processes that are inherently similar and are categorized accordingly; a logical set of actions executed in a comprehensible framework.

A project model is concise and visual, it depicts how a project will be implemented. They are specifically tailored according to each project, describing each of its functional aspects. Decision gates and partitions are important aspects and need to be exemplified throughout the project.

4 0
2 years ago
Write a function with two parameters, prefix (a string, using the string class from ) and levels (an unsigned integer). The func
Allisa [31]

Answer:

Here is the program:

#include <iostream>  //to use input output functions

#include <string>  // to use functions to manipulate strings

using namespace std;  //to identify objects cin cout

void function(string prefix, unsigned int levels){  // function that takes two parameters, a string, using the string class and levels an unsigned integer

   if (levels == 0) {  //if number of levels is equal to 0

       cout << prefix << endl;  //displays the value of prefix

       return;    }  

  for (int i = 1; i <=9 ; i++){  //iterates 1 through 9 times

       string sections = (levels == 1 ? "" : ".");  //if the number of levels is equal to 1 then empty space in sections variable otherwise stores a dot

       string output = prefix +  std::to_string(i) + sections;   // displays the string prefix followed by the section numbers. Here to_string is used to convert integer to string

       function(output, levels - 1);   } }   //calls function by passing the resultant string and levels-1  recursively to print the string prefix followed by section numbers

int main() {  // start of main function

   int level = 2;  //determines the number of levels

   function("BOX", level);  } //calls function by passing the string prefix and level value

Explanation:

The program has a function named function() that takes two parameters, prefix (a string, using the string class from ) and levels (an unsigned integer). The function prints the string prefix followed by "section numbers" of the form 1.1., 1.2., 1.3., and so on. The levels argument determines how many levels the section numbers have. If the value of levels is 0 means there is 0 level then the value of prefix is printed. The for loop iterates '1' through '9' times for number of digits in each level. If the number of levels is 1 then space is printed otherwise a dot is printed. The function() calls itself recursively to print the prefix string followed by section numbers.

Let us suppose that prefix = "BOX" and level = 1

If level = 1 then the loop for (int i = 1; i <=9 ; i++) works as follows:

At first iteration:

i = 1

i <=9 is true because value of i is 1

string sections = (levels == 1 ? "" : "."); this statement checks if the levels is equal to 1. It is true so empty space is stored in sections variable so,

sections = ""

Next, string output = prefix +  std::to_string(i) + sections; statement has prefix i.e BOX plus value of i which is 1 and this int value is converted to string by to_string() method plus sections has an empty space. So this statement becomes

string output = BOX + 1  

So this concatenates BOX with 1 hence output becomes:

output = BOX1

At second iteration:

i = 2

i <=9 is true because value of i is 2

string sections = (levels == 1 ? "" : "."); is true so

sections = ""

Next, string output = prefix +  std::to_string(i) + sections; statement becomes

string output = BOX + 2  

So this concatenates BOX with 1 hence output becomes:

output = BOX2

At third iteration:

i = 3

i <=9 is true because value of i is 3

string sections = (levels == 1 ? "" : "."); is true so

sections = ""

Next, string output = prefix +  std::to_string(i) + sections; statement becomes

string output = BOX + 3  

So this concatenates BOX with 1 hence output becomes:

output = BOX3

Now at each iteration the prefix string BOX is concatenated and printed along with the value of i. So at last iteration:

At last iteration:

i = 9

i ==9 is true because value of i is 9

string sections = (levels == 1 ? "" : "."); is true so

sections = ""

Next, string output = prefix +  std::to_string(i) + sections; statement becomes

string output = BOX + 9  

So this concatenates BOX with 1 hence output becomes:

output = BOX9

After this the loop breaks at i = 10 because the condition i<=9 becomes false. So the output of the entire program is:

BOX1                                                                                                                                          BOX2                                                                                                                                          BOX3                                                                                                                                          BOX4                                                                                                                                          BOX5                                                                                                                                          BOX6                                                                                                                                          BOX7                                                                                                                                          BOX8                                                                                                                                          BOX9  

The program along with the output is attached.

4 0
3 years ago
Suppose we compute a depth-first search tree rooted at u and obtain a tree t that includes all nodes of g.
Temka [501]

G is a tree, per node has a special path from the root. So, both BFS and DFS have the exact tree, and the tree is the exact as G.

<h3>What are DFS and BFS?</h3>

An algorithm for navigating or examining tree or graph data structures is called depth-first search. The algorithm moves as far as it can along each branch before turning around, starting at the root node.

The breadth-first search strategy can be used to look for a node in a tree data structure that has a specific property. Before moving on to the nodes at the next depth level, it begins at the root of the tree and investigates every node there.

First, we reveal that G exists a tree when both BFS-tree and DFS-tree are exact.

If G and T are not exact, then there should exist a border e(u, v) in G, that does not belong to T.

In such a case:

- in the DFS tree, one of u or v, should be a prototype of the other.

- in the BFS tree, u and v can differ by only one level.

Since, both DFS-tree and BFS-tree are the very tree T,

it follows that one of u and v should be a prototype of the other and they can discuss by only one party.

This means that the border joining them must be in T.

So, there can not be any limits in G which are not in T.

In the two-part of evidence:

Since G is a tree, per node has a special path from the root. So, both BFS and DFS have the exact tree, and the tree is the exact as G.

The complete question is:

We have a connected graph G = (V, E), and a specific vertex u ∈ V.

Suppose we compute a depth-first search tree rooted at u, and obtain a tree T that includes all nodes of G.

Suppose we then compute a breadth-first search tree rooted at u, and obtain the same tree T.

Prove that G = T. (In other words, if T is both a depth-first search tree and a breadth-first search tree rooted at u, then G cannot contain any edges that do not belong to T.)

To learn more about  DFS and BFS, refer to:

brainly.com/question/13014003

#SPJ4

5 0
1 year ago
In what section of the MSDS would you find information that may help if you use this substance in a lab with a Bunsen burner?
dybincka [34]

Answer:

The answer is "Fire-fighting measures".

Explanation:

This section is used to includes instructions to combat a chemicals flame. It is also known as the identify sources, which include the instructions for effective detonating devices and details for removing devices only appropriate for just a specific situation. It is the initiatives list, that is necessary destruction technology, materials; flaming inferno dangers.

8 0
3 years ago
Clara made ice-cream by mixing 200 g of strawberry juice with 500 g of cream. What is most likely the mass of the ice-cream form
Ronch [10]

700 g, mass of ingredients are added in this chemical change

7 0
3 years ago
Other questions:
  • Implement the simulation of a biased 6-sided die which takes the values 1,2,3,4,5,6 with probabilities 1/8,1/12,1/8,1/12,1/12,1/
    9·1 answer
  • Quantas calorias os adolescentes devem consumir diariamente?
    14·1 answer
  • An interrupt priority scheme can be used to ____. allow the most urgent work to be finished first make it possible for high-prio
    14·1 answer
  • I was logging into my origin account and this popped up. I can’t seem to click the NEXT button at the bottom. The blank spaces s
    7·2 answers
  • If an author is creating a reference list and wants the second and succeeding lines indented for a reference, they should select
    13·2 answers
  • You connect your computer to a wireless network available at the local library. You find that you can access all of the websites
    6·1 answer
  • Which of the following statements about wide area networks are true? Select 3 options.
    11·1 answer
  • Your project will require a 7-day work week rather than the traditional 5-day. How can you adapt the software to this new schedu
    15·1 answer
  • Unscramble the given word and identify the correct statement about it. ATTEPLSR
    10·1 answer
  • On the line below, write the two places you can control tab settings.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!