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
lesantik [10]
3 years ago
14

Given positive integer numInsects, write a while loop that prints that number doubled without reaching 200. Follow each number w

ith a space. After the loop, print a newline. Ex: If numInsects= 16, print:
16 32 64 128
Computers and Technology
1 answer:
Gre4nikov [31]3 years ago
3 0

Answer:

numInsects = 16

while numInsects < 200:

   print(str(numInsects) + " ", end="")

   numInsects *= 2

Explanation:

*The code is in Python.

Set the numInsects as 16

Create a while loop that iterates while numInsects is smaller than 200. Inside the loop, print the value of numInsects followed by a space. Then, multiply the numInsects by 2.

You might be interested in
Type the correct answer in the box. Spell all words corre ctly.
Andru [333]

Answer:

publication file I think ?

5 0
3 years ago
Read 2 more answers
In a newspaper advertisement for a hybrid car, which of these presentation methods would be most effective
faltersainse [42]
Your answer is a....
6 0
3 years ago
Read 2 more answers
On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance
Stels [109]

Answer:

#include <stdio.h>

int main()

{

float your_value1, your_value2, your_value3, your_value4, your_value5;

printf("Enter a frequency: ");

scanf_s("%f", &your_value1);//storing initial key frequency in your value 1

 

float r = 2.0 / 12;//typing 2.0 so it is treated as float and not int

your_value2 = your_value1 * r * 1; //initial*r*n

your_value3 = your_value1 * r * 2; //initial*r*n

your_value4 = your_value1 * r * 3; //initial*r*n

your_value5 = your_value1 * r * 4; //initial*r*n

printf("%0.2f %0.2f %0.2f %0.2f %0.2f", your_value1, your_value2, your_value3, your_value4, your_value5);

return 0;

}

Explanation:

The purpose of this exercise is to make you understand the difference between float and int. float variables are used when you need decimals in your calculations. int is used when you need integers. The problem in this exercise was the formulation of r. Now r is = 2/12, this means that when we type r as that, the computer assumes that it is an integer and treats it as such. So, it will convert the 0.166667 into 0. To overcome this, all you have to do is type 2.0 instead of 2 alone.

The %0.2 command restricts the float variable to 2 decimal places. By default, it has 6 decimal places.

I have used the function scanf_s instead of scanf simply because my compiler does not work with scanf.

3 0
3 years ago
Which of the following best describes why Earth’s atmosphere can support life on Earth?
Juliette [100K]
C. is very thin, thus allowing harmful gases to escape from it
4 0
3 years ago
What is the Rocker-Bogie System?
Dovator [93]

Answer:

The Rocker-Bogie System is the suspension arrangement developed in 1988 for use in NASA's Mars Rover Sojourner and which has become NASA's favored design for rovers.

Hope that this helps!

4 0
3 years ago
Other questions:
  • Michelle is a salesperson who is paid on commission. She just sold a customer a very reasonably priced tablet, but only after th
    14·1 answer
  • Using the Adjust group, what can you control to affect an image? Check all that apply.
    15·2 answers
  • Path of the signal of television
    6·1 answer
  • What type of chart is good for single series of data​
    15·2 answers
  • List an example of application software used in spreadsheet​
    11·2 answers
  • Answer the following questions which are based on the study "Patients' Engagement with Sweet Talk." Submit your answers.
    8·1 answer
  • What is the deck of a suspension bridge called​
    15·1 answer
  • Wap to calculate the simple interest for the given PTR​
    14·1 answer
  • _______ are useful when you want the user to select one choice from several possible choices. Radio buttons Check boxes Buttons
    5·1 answer
  • What is the accurate description
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!