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
Leno4ka [110]
3 years ago
11

Insect population An insect population doubles every generation. Write a while loop that iterates numGeneration times. Inside th

e while loop, write a statement that doubles currentPopulation in each iteration of the while loop. Function Save Reset MATLAB DocumentationOpens in new tab function currentPopulation = CalculatePopulation(numGeneration, initialPopulation) % numGeneration: Number of times the population is doubled % currentPopulation: Starting population value i = 1; % Loop variable counts number of iterations currentPopulation = initialPopulation; % Write a while loop that iterates numGeneration times while ( 0 ) % Write a statment that doubles currentPopulation in % each iteration of the while loop % Hint: Do not forget to update the loop variable end end 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Code to call your function
Computers and Technology
1 answer:
yuradex [85]3 years ago
6 0

Answer:

function currentPopulation = CalculatePopulation(numGeneration, initialPopulation)

    i = 1;

    currentPopulation = initialPopulation;

    while(i <= numGeneration)

         currentPopulation = 2* currentPopulation;

         i= i+1;

    end

end

Explanation:

  • Assign 1 to i as an initial loop value .
  • Assign  initialPopulation to currentPopulation  variable.
  • Run the while loop until i is less than numGeneration.
  • Inside the while loop, double the currentPopulation  variable.
  • Inside the while loop, Increment the i variable also.

You might be interested in
The intended purpose of the following module is to determine whether the value parameter is within a specified range. The module
BARSIC [14]

The program does not consists of any syntax error but the module contains error in logic especially while placing the condition inside if statement.

Here we are actually planning to check whether the number passed in the “value” variable is within the given lower and upper range which is passed in second and third parameter.

Solution 1:

if value<=lower AND value>=upper Then

Display “The given number is outside the specified range.”

else

Display “The given number is within the specified range.”

End if

Alternate solution:

So for that the condition needs to be value>=lower and value <=lower. so  

if value > lower AND value <upper Then

Display “The given number is within the specified range.”

else  

Display “The given number is within the specified range.”

7 0
4 years ago
2. Which company was first able to send a text? (Verizon, AT&amp;T, Cricket???)
zheka24 [161]

Answer:

I would say Nokia

Explanation:

Nolia was the first to create an SMS text message in 1993.

sorry if I am wrong :c

3 0
3 years ago
The Internet is written in a "language" called
olganol [36]

Answer:

HTTP

Explanation:

I hope it helps u.

Mark Me as brainlist answer

4 0
3 years ago
Read 2 more answers
int replace_text (Document *doc, const char *target, const char *replacement) The function will replace the text target with the
Paraphin [41]

Answer:

int replace(Document *doc, const char *target, const char *replacement){

int i, j, k;

int beginning;

char temp[MAX_STR_SIZE + 1] ;

 

char *beginning, *end, *occ, *line;

if(doc == NULL || target == NULL || replacement == NULL)

return FAILURE;

for(i = 0; i < doc->total_paragraphs; i++){

for(j = 0; j < doc->paragraphs[i]->total_lines; j++){

line = doc->paragraphs[i]->lines[j];

beginning = line;

end = beginning + strlen(line);

strcpy(temp, "");

while(beginning < end && (occ = strstr(beginning, target))!= NULL){

len = occ - beginning;

strncat(temp, beginning, len);

strcat(temp, replacement);

beginning = occ + strlen(target);

}

strcat(temp, beginning);

strcpy(doc->paragraphs[i]->lines[j], temp);

}

}

return SUCCESS;

}

Explanation:

  • Loop through total paragraphs and total lines.
  • Store the beginning and ending of paragraph in specific variables.
  • Copy the remainging chars .
  • Finally return SUCCESS.
4 0
3 years ago
WordArt ____ in the interior of a letter can consist of a solid color, texture, picture, or gradient.
Svetach [21]
WordArt fill in the interior of a letter can consist of a solid color, texture, picture, or gradient. 
3 0
4 years ago
Other questions:
  • Which of the following are true statements about the data that can be represented using binary sequences?
    5·1 answer
  • Which boolean operator (and, not, or or) gives you the least results? *?
    6·1 answer
  • The OSI is a reference system that is used by most types of technicians EXCEPT _____.
    11·2 answers
  • Why should ERP architecture include a discussion on organizational structure, business processes, and people, instead of just in
    5·1 answer
  • Mention two hardware groups​
    7·1 answer
  • Where the heck is the leader board?
    5·1 answer
  • Why are response tests more difficult for some students? What can you do to make them easier for yourself?
    10·2 answers
  • Please help coding assignments i will give brainliest :)
    6·1 answer
  • How does beamforming improve network service?
    14·1 answer
  • How bridges are built over water
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!