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
What are wizard ranks in brainly​
Hunter-Best [27]

Answer:

Brainly gives special ranks to users who give outstanding performance in a specific subject. These ranks are known as Wizard rank. Specifically for only one person in each subjects: Maths, Chemistry, Physics, Biology, and English.

Explanation:

4 0
2 years ago
Read 2 more answers
Help Asap! Marking brainliest!✨
gulaghasi [49]

Answer:

The answer would be After the slide you are viewing.

I hope this helped!

8 0
3 years ago
Read 2 more answers
Which type of computer network ensures high security
Gwar [14]

Answer:

I elieve the answer for this is Juniper Network Firewall

Hope this helps

3 0
2 years ago
Is jesus dead or alive
Morgarella [4.7K]

Answer:

Explanation:

i think he alive but in heaven i dunno

8 0
3 years ago
What is cyber safety?
mario62 [17]

Answer: Cyber safety is a process that protects computers and networks. The cyber world is a dangerous place without security and protection.

Explanation: Hope this helps!

7 0
3 years ago
Other questions:
  • What are some good editing software apps for pc?
    11·1 answer
  • Provide an example of a time in your personal or work life when you used the household measuring system and measured out an exac
    6·1 answer
  • Which one of these tasks is part of the pre-production phase of game development?
    11·2 answers
  • Cryptcat is a Linux distribution that includes hundreds of security and hacking tools, including Nessus and Metasploit. It can p
    11·1 answer
  • What can you do to help create a safe online environment?
    8·2 answers
  • The scientific process is most similar to what
    10·1 answer
  • Why do we need operating systems?
    7·1 answer
  • Which display technology was developed by apple, produces vibrant colors, and supports viewing from all angles?
    12·1 answer
  • Drag the tiles to the boxes to form correct palrs.
    9·1 answer
  • Array bounds checking should be directly coded into a system rather than assumed.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!