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]
2 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]2 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
Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all th
Whitepunk [10]

Answer:

Following are the statement in C++ Language is given below

total=0; // variable declaration

cin >> amount; // Read the input

while(amount >=0) //iterating the loop

{

if(amount>0) // checking condition

total=total+amount; // perform operation

}

Explanation:

Following is the description of the statement

  • Declared a variable "total" and initialized with them 0 to them.
  • Read the input in the "amount" variable by using cin.
  • iterating the loop when the amount is greater then 0.
  • Checking the condition if(amount>0) then adding the total variable and amount and storing them into the total variable.

8 0
3 years ago
How does a search engine use algorithms to provide search results?
Lyrx [107]

Answer:

By retrieving and ranking relevant search results

Explanation:

6 0
2 years ago
Read 2 more answers
When copying a pie chart from Calc or Excel to Impress or PowerPoint, once the chart has been pasted, it cannot be edited.
dem82 [27]
The answer is true
i think
7 0
2 years ago
Read 2 more answers
3. is the system of rules that govern the ordering of values? culture a. Ethics b. organization c. protocol d. value system 3 .
Norma-Jean [14]

Answer:

ethics

Explanation:

The set of principles that guides the ordering of values is known as ethics. Scenario, challenge, or event in which a person has to choose between various morally correct or bad behaviors. The moral principles and norms that govern conduct in the business world.  The rules or norms that regulate a specific individual or a group's behavior. It is also the ethical ideas and standards that society accepts as right or good as opposed to immoral or undesirable.

7 0
1 year ago
I watched an ad but the im button done is no where in sight, has anyone else experienced this recently. it was fine a few days a
Maurinko [17]

Answer:

This is usually just a small glitch that happens sometimes when you are seeing an ad and wanting to skip. Simple fixes to this problem include refreshing the browser or closing the application that you are in. This also would happen to me but following this fix should help with the problem.

7 0
1 year ago
Other questions:
  • In Linux, the most popular remote access tool is OpenSSH. Which software performs the same remote command line (CLI) access from
    7·1 answer
  • Which type of topology describes the physical arrangement, installation, and connection of cables, computer, and other devices?
    10·2 answers
  • For the following array x [10] = { 45, 20, 50, 30, 80, 10, 60, 70, 40, 90} show the contents of x after the function call split
    6·1 answer
  • What is the correct process for inserting a blank worksheet in Google sheets
    12·1 answer
  • The second step when using the problem-solving process is to
    7·1 answer
  • What important practice can help prevent hardware trouble?
    6·1 answer
  • Dallas is an analyst at an online retailer. He is great at creating representative diagrams showing the relationships between cu
    12·1 answer
  • Which feature helps an edit-test-bug cycle work faster in the python programming language?
    15·2 answers
  • What does the following loop do? val = 0 total = 0 while (val &lt; 10): val = val + 1 total = total + val print(total)
    15·1 answer
  • The IPv6 address for an Ethernet connection begins with FE80::/64. What does this tell you about the address
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!