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
weqwewe [10]
3 years ago
8

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 import java.util.Scanner;public class InsectGrowth {public static void main (String [] args) {int numInsects;Scanner scnr = new Scanner(System.in);numInsects = scnr.nextInt(); // Must be >= 1/* Your solution goes here */}}
Computers and Technology
1 answer:
True [87]3 years ago
5 0

Answer:

The below code is pasted in the place of "/*Your solution goes here */"

while(numInsects<200) // while loop

       {

            System.out.print(numInsects+" "); // print statement

            numInsects=numInsects*2; // operation to print double.

       }

Output:

  • If the user gives inputs 16 then the output is 16 32 64 128.
  • If the user gives inputs 25 then the output is 25 50 100.

Explanation:

  • The above code is in java language in which the code is pasted on the place of "Your solution" in the question then only it can work.
  • Then the program takes an input from the user and prints the double until the value of double is not 200 or greater than 200.
  • In the program, there is while loop which checks the value, that it is less than 200 or not. If the value is less the operation is performed otherwise it terminates.
You might be interested in
What type of account should you use fro signing in to your windows 8 computer if you want to synchronize your settings on other
nikklg [1K]
You should use your Microsoft account because this will sync to all your windows devices.
8 0
3 years ago
In order for a fault-block mountain to form, a ______ must take place along a fault line and one side must be ________.
Sav [38]
I think the correct answer from the choices listed above is the first option. In order for a fault-block mountain to form, a shift must take place along a fault line and one side must be elevated. Fault-block mountains form<span> when Earth's crust pushes material up and down near a </span>fault line<span>. Hope this answers the question.</span>
7 0
3 years ago
A videogame designer would be most interested in the _____ elements of beowulf.
adelina 88 [10]
I think he would be interested in a. epic elements of beowulf.
5 0
3 years ago
Read 2 more answers
The following code will create a zombie child process because the child process is terminated and the parent process is busy in
Georgia [21]

Answer:

what on earth

Explanation:

5 0
3 years ago
What kind of company would hire an Information Support and Service employee?
Anni [7]
A service company would hire an Information Support and Service employee.

hope it helps you!
6 0
3 years ago
Read 2 more answers
Other questions:
  • Liz will use a CD-R compact disk to write to more than once. Carlo will use a CD-RW compact disk to write to more than once. Who
    8·2 answers
  • There are two activities on your schedule, which are: 1) install server in lab 2) move server into the data center. however, the
    6·1 answer
  • What does prominent hyperintensity mean relating to MRI?
    5·1 answer
  • I need someone who knows HTML to finish the code.
    12·2 answers
  • Given a double variable named areaofsquare write the necessary code to read in a value , the area of some square, into areaofsqu
    9·1 answer
  • A motorist is using the AHP to choose a new car from three possible models Arrow, a Bestmobile and a Commuter. The choice will a
    15·2 answers
  • Miguel owns a tile business. He has two employees who work in a small office. One answers phones and schedules appointments. Ano
    11·2 answers
  • What is social media ​
    13·2 answers
  • Will mark Brainliest!! What is the best memory to use on a computer? Why?
    9·1 answer
  • Write program to read 10 random numbers, then find how many of them accept division by 4,
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!