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
Describe the necessary Java commands to create a Java program for creating a lottery program using arrays and methods.
netineya [11]
I think each lottery ticket will cost £5 each so you would count in 5s till you reach the amount of tickets to get the answer which is £25
5 0
2 years ago
Read 2 more answers
Select the correct statement(s) regarding Frame Relay (FR). a. FR is a connection-oriented standard that operates at the OSI lay
DedPeter [7]

Answer:

d. all of the statements are correct

Explanation:

Frame Relay is a high-performance WAN protocol that operates at the physical and data link layers of the OSI reference model. i.e Layers 1 and 2 They are designed to cope with bursty traffic. Frame relay is also a form of data networking based on packet switching in which the packets are variable in length and experience packet delays.

Based on the above definition the correct statement is option d as all of the statements define in the other option correctly defines the function of frame relay.

7 0
3 years ago
Need help with this is photography :)
mestny [16]

Answer:

UV filter, This filter blocks UV light and removes the blue cast from images taken in very bright sunny conditions. ... With old film cameras it was often necessary to use a UV filter because film is extremely sensitive to UV light.

8 0
3 years ago
Help me pleaseeee!
kenny6666 [7]

Answer:

Try checking around on the router!

Explanation:

Assuming they haven't changed it, most routers have their default password displayed somewhere on it. I hope this helps!! ^^

5 0
2 years ago
Read 2 more answers
Explain the application of artificial applications.
qwelly [4]

Explanation:

AIAI or artificial intelligence is the simulation of human intelligence processes by machines, especially computer systems. These processes include learning, reasoning and self-correction. Some of the applications of AI include expert systems, speech recognition and machine vision. Artificial Intelligence is advancing dramatically. It is already transforming our world socially, economically and politically.

AI was coined by John McCarthy, an American computer scientist, in 1956 at The Dartmouth Conference where the discipline was born. Today, it is an umbrella term that encompasses everything from robotic process automation to actual robotics. AI can perform tasks such as identifying patterns in the data more efficiently than humans, enabling businesses to gain more insight out of their data. With the help from AI, massive amounts of data can be analyzed to map poverty and climate change, automate agricultural practices and irrigation, individualize healthcare and learning, predict consumption patterns, streamline energy-usage and waste-management.

6 0
3 years ago
Read 2 more answers
Other questions:
  • What are options in the Advanced tab in the Share Workbook dialog box? Check all that apply
    14·2 answers
  • Francis has designed a picture book appropriate for third graders. He wants teachers across the world to freely download use, an
    9·1 answer
  • Bill needs to make a presentation in which he has to represent data in the form of a pyramid. Which feature or menu option of a
    10·2 answers
  • The expression that is tested by a switch statement must have a(n) __________ value.
    12·1 answer
  • Of the listed principles, which one states that multiple changes made to computer systems shouldn’t be made simultaneously?
    9·1 answer
  • Mario wants to use computer.what is the first thing needs to know<br><br>​
    6·1 answer
  • Which programming languages are the best choices for desktop applications? Select 3 options.
    8·2 answers
  • Assume three jobs arrive at approximately the same time (arrival time are all 0), but Job A arrives slightly before Job B, and J
    13·1 answer
  • Moving images of real event​
    12·2 answers
  • To track what level a player is on, you can create a simple variable and a block saying change level by 1 attached to the when g
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!