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
AveGali [126]
3 years ago
8

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

ith a space. After the loop, print a newline. Ex: If numInsects = 8, print:
8 16 32 64
import java.util.Scanner;

public class InsectGrowth {
public static void main (String [] args) {
int numInsects = 0;
Computers and Technology
1 answer:
DIA [1.3K]3 years ago
7 0

Answer:

import java.util.Scanner;

public class InsectGrowth {

   public static void main (String [] args) {

       int numInsects = 8;

       while(numInsects < 100){

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

           numInsects = numInsects *2;

       }

       System.out.println();

   }

}

Explanation:

Create the main function and define the variable numInsects with value 8.

Take the while loop and it run until numInsects less than 100.

Inside the loop. first print the value and less double the numInsects value.

for example:

suppose, numInsects  = 2

the, check condition 2 < 100, true

print(2)

numInsects  = 2* 2=4

second time, numInsects  = 4

the, check condition 4 < 100, true

print(4)

numInsects  = 4* 2=8

and so on, until  numInsects  < 100.

Print each number with space and finally when the loop is terminate print the new line.

You might be interested in
To define an additional field in Datasheet view, tap or click the ____ column heading.
Ksenya-84 [330]
The correct answer for the question that is being presented above is this one: "D) click to add." To define an additional field in Datasheet view, tap or click the<span> click to add </span>column heading.
Here are the following choice:
A) insert field
B) blank field
C) new field
D) click to add
3 0
3 years ago
Cyber security class i need help​
makkiz [27]

Answer:

Explanation:

yooooo it b

5 0
2 years ago
Who is the host in super monkey ball?
Savatey [412]

Answer:

Brian

Explanation:

3 0
3 years ago
Which device makes telecommunications possible?
Dmitrij [34]
A. modem or d. voice input. Not a port because a port allows one to insert a peripheral device but not really communicate. I have no idea what an expansion slot is. It could be d. voice input because this allows a person to hold an audible conversation.

But  I'd go for modem because a modem lets you connect devices like laptops, tablets, phones, computers etc. and share data between them. So things like mailing are possible (I THINK)!  <span />
7 0
3 years ago
Imagery functions as a coding system to help individuals acquire movement patterns. this describes
denis-greek [22]

Answer:

Imagery can be used to develop qualities in yourself you'd like to have — it's like emotional body-building — and using a technique called “Evocative Imagery” you can cultivate courage, patience, tolerance, humor, concentration, self-confidence or any other quality you'd like to embody.

3 0
2 years ago
Other questions:
  • Which phrase best describes a scenario in Excel 2016?
    9·1 answer
  • To move up one paragraph, press the ____ key(s). f1 alt up arrow up arrow ctrl up arrow
    8·1 answer
  • Which type of software is the most similar to database software?\
    5·1 answer
  • This is not a feature provided by most GUIS.<br> icons<br> windows<br> forms<br> menus
    14·2 answers
  • Select the correct answer from each drop-down menu.
    10·2 answers
  • Consider the conditions and intentions behind the creation of the internet—that it was initially created as a tool for academics
    12·1 answer
  • What complications are imposed if one tries to implement a dynamic list using a traditional one-dimensional array
    14·1 answer
  • The web design teams of a company are working on designing websites for various companies, Pick the ideas that employ proper use
    13·1 answer
  • What is the launching of a 3-D map called?
    12·1 answer
  • Consider that a man is watching a picture of a Black Horse. He receives an external stimulus from input channel. Man gains some
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!