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
umka2103 [35]
3 years ago
8

Given positive integer num_insects, write a while loop that prints that number doubled up to, but without exceeding 100. Follow

each number with a space. Sample output with input: 8 8 16 32 64
Computers and Technology
1 answer:
nasty-shy [4]3 years ago
5 0

Answer:

import java.util.Scanner;

public class CocaColaVendingTest {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter value for number of insects");

       int num_insects = in.nextInt();

       while (num_insects<=100){

           System.out.print(num_insects);

           num_insects*=2;

           System.out.print(" ");

       }

   }

}

Explanation:

In the code above written in Java.

The user is prompted to enter a positive value for the number of insects

This is stored in a variable num_insects.

Using a while loop with the condition while (num_insects<=100). The num_insects is printed out. Then it is doubled followed with a space.

It continues until the condition in the while loop is no longer true

You might be interested in
How can chess computers be programmed so that it can be so accurately adjusted to a skill level ranging from a beginner to a gra
Elis [28]
They are artificially intelligent. They watch thousands of hours of videos of the game they are going to play. After they learn, they challenge themselves against themselves and save all the moves it used that time, they play another game against the saved game and if they best it then they save the new and repeat. I am not sure about this because I am just a 15 yr old but the early ones brute forced the game and one. Brute Forcing is a way to try out every possible move and pick the most like to succeed or the most efficient one, brute force is also used in hacking or cracking passwords that have something in common. Like let's say ur password is Jakeis35. I would make a list that would be:
Jake
jake
Is
is
35
34

and with a software it will put together every possible pair and will stop when it matches the password on the server or if the password let it login.
5 0
3 years ago
Which command would you use on a switch to enable management from a remote network?
Savatey [412]
<span>IP default-gateway 192.168.10.185</span>
7 0
3 years ago
Which feature of the excel window displays the contents of an active cell
VLD [36.1K]
Formula bar feature of the excel window displays the content of an active cell.


7 0
3 years ago
Read 2 more answers
What device is used to transmit what is effectively a type of Morse code between stations?
IrinaVladis [17]
<h3>Its B 100% sure.....</h3>

Brainiest Please :)

6 0
2 years ago
SOMEONE PLEASE HELP ME OUT WITH!!!!!
Olin [163]
I’m pretty sure it’s the second one. that’s what i’d choose
8 0
2 years ago
Read 2 more answers
Other questions:
  • What are the names of each devices pleaseee​
    13·2 answers
  • Can Sombody please help me with this question, I'm struggling!
    7·1 answer
  • In terms of resource utilization, a /an application may require higher local
    8·1 answer
  • You can put a small level on your camera to help keep the horizons straight? TRUE OR FALSE
    14·2 answers
  • Can anyone please help with this programming code in python num= 7 if num &gt; 3: print(“3”) if num &lt; 5: print(“5”) if num ==
    6·1 answer
  • A company wants to publish Knowledge articles to its Customer Community. The articles should be organized for easy navigation by
    6·1 answer
  • I will upvote....
    10·1 answer
  • D) Informal high level descuption of an algorithm in english kcalled
    9·2 answers
  • Any correct answers will be helpful.
    13·1 answer
  • Explain why it is important that the device registration is the last thing that is done in the initialization routine of a devic
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!