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
When did mac start? when did windows start? when did lynux start?
ale4655 [162]

Answer: Macintosh start January 24, 1984

Windows start November 20, 1985

Linux start October 5, 1991

7 0
3 years ago
Read 2 more answers
To type the letter address, _________ space from the dateline
miskamm [114]

Answer: Double

Explanation:

I just took the test

4 0
3 years ago
Read 2 more answers
How i can download play store?​
Phantasy [73]

Answer:

in Google type play Store and you will get the app and then click on that word install and it will get installed

Explanation:

hope this helps

3 0
3 years ago
Why should information technology NOT be taught in school?​
tatiyna

Explanation:

Technology should not be used to teach in school as it can lead to distractions. With kids wanting to explore other sights, cheating, and communicating with others. Also, it can be expensive to purchase the technology for everyone as it can be a major investment with hundreds or thousands going into it. Technology also requires a lot of training by having to adapt lessons compatible with the systems and making sure the software is secure.

5 0
3 years ago
Martha and her project group want to present the class their work in the form of a slideshow that includes charts. Which applica
Gennadij [26K]

Answer:

Your answer is D.  multimedia software

Explanation:

6 0
3 years ago
Other questions:
  • What is the best way to protect computer equipment from damage caused by electrical spikes?
    9·2 answers
  • Which one of the following parts of a universal motor does not move? A. The armature B. The field coil C. The shaft D. The commu
    5·1 answer
  • Which of the following is a narrative essay most like?
    10·2 answers
  • How do you copy and paste plz let me know
    14·2 answers
  • The block of code below is supposed to display “multiple of 5” if the positive number value is in fact a multiple of 5
    8·1 answer
  • Which CIDR network has the smallest possible number of hosts? a. 123.0.0.0/8 b. 123.45.0.0/16 c. 123.45.67.0/24 d. All have the
    10·1 answer
  • Choose the parts of the browser window. PLEASE ANSWER QUICKLY TEST
    12·2 answers
  • Which item is used for formatting in responsive web design?
    14·2 answers
  • Write a function longer_string() with two string input parameters that returns the string that has more characters in it. If the
    5·1 answer
  • Consider the following code using the posix pthreads api:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!