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
Analyzing computer systems to gather potential legal evidence is computer ________
hodyreva [135]
It is called computer forensics.
5 0
3 years ago
C) Explain GIGO briefly.​
hodyreva [135]

Answer:

Is is also a computer science acronym that implies bad input will result in bad output. Requiring valid input also helps programs avoid errors that can cause crashes and other erratic behavior.

IT'S FORMULA IS GIGO: GARBAGE IN GARBAGE OUT...

HOPE IT'S HELPFUL FOR U!!

AND PLZ MARK ME AS BRAINLIEST IF U LIKE THIS ANSWER!!!!

4 0
3 years ago
What is the definition of phishing with an example
Diano4ka-milaya [45]
Phishing is an ability of fraudulently obtaining personal info.
synonyms: Fraud and scam
8 0
3 years ago
What are the 6 example of computer hardware​
zheka24 [161]

Answer:

Monitor.

Motherboard.

CPU(Microprocessor.

Main memory(RAM)

Expansion cards.

Power supply unit.

Explanation:

7 0
3 years ago
Read 2 more answers
Hiiiiiiiiiii hiiiiiiiiiiiiiiiiiii
jenyasd209 [6]

Gimme Brainliest.

--------------------------

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which osi layer is responsible for combining bits into bytes and bytes into frames?
    8·1 answer
  • How do humans acquire voltage in their bodies
    8·1 answer
  • C++ what is wrong with my equation?
    10·1 answer
  • A database is a collection of ________ data.
    15·1 answer
  • What are two example of ways an electronic record may be distributed to others?
    11·1 answer
  • Ites and days, on one of the slides in her school presentation. Which element can she use to
    12·2 answers
  • Convert the following denary numbers into binary using 8-bit register:
    6·1 answer
  • Setting up a desktop computer for anAutoCADspecialist who needs a minimum of 125 GBram which operating system would be the best
    5·1 answer
  • Why is cyberbullying so devastating to many people beyond just the victim?
    8·1 answer
  • Completar Fill in the blanks with the correct familiar commands. dar (negative) 1 of 1 Question 2 with 1 blank hacer (affirmativ
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!