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]
3 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]3 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
Two types of are desktop computers and notebook computer
aalyn [17]

Explanation:

A. personal computer

wait others answer for sure

4 0
3 years ago
Read 2 more answers
When copying and pasting text, the first step is _____.
Paul [167]

Answer:

type the,yext is the first step

4 0
3 years ago
Read 2 more answers
Which of the following statements is true?
Sonbull [250]

Answer:

C

Explanation:

Predicate methods typically test a condition and do not modify the object on which they're called.

6 0
3 years ago
A mom is planning a theme park trip for her husband, herself, and their three children. The family has a budget of $500. Adult t
dolphi86 [110]

Complete question :

Sue is planning a theme park trip for her husband, herself, and her three children. She has a budget of $500. Adult tickets cost $55 each, and child tickets cost $25 each. Which formula should go in cell B4?

Answer:

=E1B1+E2B2

Explanation:

Cost of adult ticket = $55

Child ticket = $25

Number of adult = 2

Number of children = 3

Assume :

Cost of adult ticket = $55 = E1

Child ticket = $25 = E2

Number of adult = 2 = B1

Number of children = 3 = B2

The formula that should go into cell B5 in other to calculate total amount :

Total should be :

($55*2) + ($25*3)

=E1B1+E2B2

6 0
2 years ago
Desertification is caused by
Alex Ar [27]
<span>it is caused by A.overgrazing
</span>
5 0
3 years ago
Other questions:
  • Sugar can be listed in many different forms except
    9·1 answer
  • Match each storyboarding technique with its appropriate description
    9·1 answer
  • (50 points) Write a program arrays1.cthat checks if two integer arrays are different by one and only one elementwhen compared el
    5·1 answer
  • . Given an initially empty stack s that accepts integers, the following operations are performed: s.push (10) s.push (20) s.push
    13·1 answer
  • The family size bottle of sunscreen holds 121212 fluid ounces (\text{fl oz})(fl oz)(, start text, f, l, space, o, z, end text, )
    12·1 answer
  • Write a program that determines the value of the coins in a jar and prints the total in dollars and cents. Read integer values t
    5·1 answer
  • What is the age group for the silent genration
    10·1 answer
  • Java code?????
    12·1 answer
  • What are some ways you can give staying off your phone a "boost" and make it easier to do?
    9·1 answer
  • Which statement is true about the energy of electromagnetic radiation?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!