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]
4 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]4 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
6.Decreasing a telescope's eyepiece focal length will:
Ghella [55]
B is the correct answer to ur questions
8 0
4 years ago
What are the raw materials for the process of photosynthesis​
Ray Of Light [21]
The raw materials of photosynthesis, water and carbon dioxide, enter the cells of the leaf, and the products of photosynthesis, sugar and oxygen, leave the leaf.
7 0
3 years ago
Read 2 more answers
Namecoin is an alternative blockchain technology that is used to implement decentralized version of Routing Banking System.A. Tr
vova2212 [387]

Answer:

False

Explanation:

Namecoin is a type of crypto currency which was originally pronged from Bitcoin software. It is coded in the fashion of Bitcoin with the same algorithm as well. Hence it is not a blockchain technology that is used to implement decentralized version of Routing Banking System. Namecoin can store data within its own blockchain transaction database.

4 0
3 years ago
Which of the following is something that all computer models use in their calculations?
Rzqust [24]
The answer is 4 because all computers use variables to process something
8 0
3 years ago
Convert to binary140
marshall27 [118]

00110001 00110100 00110000

5 0
3 years ago
Other questions:
  • By defeaut, Excel cells are top aligned<br><br> a. True<br><br> b. False
    12·1 answer
  • 1. Access and PowerPoint are not included in all configurations of Microsoft Office 2013.
    14·1 answer
  • Write a program with a function that accepts a string as an argument and returns a copy of the string with the first character o
    11·1 answer
  • True or False? In a C++ floating-point constant, a decimal point is not required if exponential (E) notation is used
    13·1 answer
  • Which one of the following statements is true regarding the fetch-execute cycle? Each step of the fetch-execute cycle is perform
    15·1 answer
  • Plz help<br> What is an ASCII?
    10·2 answers
  • You have a small business.Due to the recent pandemic you seem to be losing contacts with your suppliers and customers.You want t
    10·1 answer
  • How i simplify this boolean expression ?A'.B'.C'+A'.B'.C+A'.B.C+A.B'.C+A.B.C
    6·2 answers
  • Figure out what this says:<br><br> ?driew tib a kool ti seoD
    7·1 answer
  • System development life cycle
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!