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]
4 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]4 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
Which flowchart symbol is called the process symbol and contains the steps or actions in the process being depicted?
Mamont248 [21]
I am 95% sure that the answer is B.


I am not 100% but pretty sure the answer is B. I recommend waiting for someone else's response.

The answer is either B or C.
6 0
3 years ago
Read 2 more answers
True or False
steposvetlana [31]

Answer:

1. False

2. False

3. True

4. False

Explanation:

1. Folders are the containers to store files

2. The delete option deletes the file

3. Files are moved to recycle bin after being deleted, and can be permanently deleted from recycle bin

4. "MS-DOS was the main operating system for IBM PC compatible personal computers during the 1980s, from which point it was gradually superseded by operating systems offering a graphical user interface (GUI), in various generations of the graphical Microsoft Windows operating system."

<em>source for #4: Wikipedia</em>

3 0
3 years ago
"When a large data file needs to be processed in ascending or descending order based on a particular field, the most efficient a
Alona [7]

Answer:

Yes

Explanation:

For example, We need to write down the names of student in a school for survey purposes, rather than tell everyone to write their names on a sheet of paper and submit, we can instruct that names be written according to their classes and then written on the class sheets alphabetically.

Logically names will be written according to the classes from Class 1 - 10, then on the class sheet alphabetically from A - Z. its better represented that way for easy understanding and better collation and interpretation of data.

7 0
4 years ago
Need help with 3.2 lesson practice questions (edhesive)​
Vinvika [58]

Answer:

<h2>Doesn't have a question</h2>

Explanation:

<h2 /><h2>THANK YOUU</h2>
7 0
3 years ago
What is it called when you make predictions within given data?
denis23 [38]
<span>When a researcher uses given data to make a prediction, this is known as a hypothesis. The hypothesis generally serves as a starting point for future research, allowing a researcher to further develop their theory through additional testing, observation, and, if necessary, revision to the current hypothesis.</span>
4 0
3 years ago
Other questions:
  • One form of the IF field is called an If…Then…Else: If a condition is true, then perform an action; else perform a different act
    15·2 answers
  • 1 what elements of composition are under your control in photoshop
    13·1 answer
  • You can install several printers on your machine, but at least one must be the _______ printer.
    6·1 answer
  • A tool in Word that creates multiple copies of the same letter, envelope, or label and inserts personalized data is a(n) _____.
    12·1 answer
  • According to your text, three factors are responsible for the rapid rise in new product development. They are faster and more ec
    9·1 answer
  • . Which one of the following is not a JAD participant? 1. Managers 2. System analyst 3. Business development manager 4. Users
    7·1 answer
  • When you leave your computer for a short period of time, why should you put your computer into Standby mode?
    5·2 answers
  • Which statement regarding killers is true?
    12·2 answers
  • Explain steps in creating a main document for from letter. <br>​
    5·1 answer
  • What feature do you need on a computer if you want to take it on vacation to another continent?A. Dual-voltage selector switch B
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!