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
Type the correct answer in the box. Use numerals instead of words. If necessary, use / for the fraction bar.
andriy [413]

Binary values are used to denote the 'ON' and 'OFF' state of a computer. The 'ON' state is denoted by the binary value '1'

  • The 'ON' state of a computer represents the mode when the computer system is running and can be used to perform computing operations.

  • The binary values '0' and '1' are used to designate the ON and OFF state.

  • When the computer is ON, it is designated by the binary value 1 ; while the OFF state is designated by the binary value 0.

Therefore, the number which signifies the ON state of a computer is 1.

Learn more :brainly.com/question/4722254

4 0
2 years ago
Assume you are using the MINUS operator to combine the results from two tables with identical structure, CUSTOMER and CUSTOMER_2
MariettaO [177]
The result of MINUS operator will be 10 - 2 = 8 records (number of records in CUSTOMER - number of common records).
5 0
3 years ago
Web analytical packages can obtain the following information when someone visits a website, except Group of answer choices name
il63 [147K]

Answer:

name and address of web visitors.

Explanation:

A website refers to the collective name used to describe series of web pages linked together with the same domain name.

Web analytical packages are software features that are typically used for tracking the identity of a computer system by placing or adding cookies to the computer when it's used to visit a particular website. Thus, it's only used for tracking the identity of a computer but not the computer users.

This ultimately implies that, web analytical packages can obtain the geographic location, Internet connection type, and navigation source information when someone visits a website, but it cannot obtain the name and address of web visitors or users.

3 0
3 years ago
In distributed dos attacks, the attacker sends messages directly to ________. bots the intended victim of the dos attack backdoo
kirill115 [55]
The word DoS refers to the Disk Operating System. In the case given above, if it happens that there is a distributed DoS attack, the attacker then sends messages directly to the BOTS. Bots refer to internet or web robots. Hope this answer helps. The answer is the first option.
4 0
3 years ago
What’s the purpose of balancing or monitoring your checking account?
emmasim [6.3K]
B) To help you calculate how much money you have in your account.
3 0
3 years ago
Read 2 more answers
Other questions:
  • People use a computer connected to the internet to manage financial accounts
    15·1 answer
  • When evaluating mining results, data mining and evaluating becomes
    6·1 answer
  • What image format should be used to keep the file size manageable​
    14·1 answer
  • You have been given the job of creating a new order processing system for the Yummy Fruit CompanyTM. The system reads pricing in
    8·1 answer
  • What task does the casting director do, apart from auditioning actors?
    8·1 answer
  • Is it possible to have a deadlock involving only oneprocess? Explain your answer.
    11·1 answer
  • A type of multiprocessor chip that provides two or more separate and independent CPUs.
    8·1 answer
  • To configure a router/modem, what type of IP interface configuration should you apply to the computer you are using to access th
    10·1 answer
  • What is closeable interface in java.
    12·1 answer
  • Which of the following rules need to be followed when using variables?<br> Choose all that apply.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!