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
weqwewe [10]
3 years ago
8

Given positive integer numInsects, write a while loop that prints that number doubled without reaching 200. Follow each number w

ith a space. After the loop, print a newline. Ex: If numInsects = 16, print:16 32 64 128 import java.util.Scanner;public class InsectGrowth {public static void main (String [] args) {int numInsects;Scanner scnr = new Scanner(System.in);numInsects = scnr.nextInt(); // Must be >= 1/* Your solution goes here */}}
Computers and Technology
1 answer:
True [87]3 years ago
5 0

Answer:

The below code is pasted in the place of "/*Your solution goes here */"

while(numInsects<200) // while loop

       {

            System.out.print(numInsects+" "); // print statement

            numInsects=numInsects*2; // operation to print double.

       }

Output:

  • If the user gives inputs 16 then the output is 16 32 64 128.
  • If the user gives inputs 25 then the output is 25 50 100.

Explanation:

  • The above code is in java language in which the code is pasted on the place of "Your solution" in the question then only it can work.
  • Then the program takes an input from the user and prints the double until the value of double is not 200 or greater than 200.
  • In the program, there is while loop which checks the value, that it is less than 200 or not. If the value is less the operation is performed otherwise it terminates.
You might be interested in
Which of the following is not a command for determining if MySQL is running on Linux (Ubuntu)?
laila [671]

Answer:

(c) sudo check status mysql

Explanation:

The commands service<em>, </em>ps<em> </em>and<em> </em>systemctl<em>, </em>are different ways to find out <em>if MySQL is running on Linux (Ubuntu), </em>but there is not such a command called <em>check</em> to do so in Linux.

Different programs in Linux operating system are organized in <em>processes</em>, and they are all created for a specific purpose: running an application, starting a web browser, and so on.

Some other programs like the <em>init program</em> start and stop essential service processes and there are currently two major implementations in Linux distributions:

  • <em>System V init</em> (traditional implementation)
  • <em>systemd</em> (emerging standard for <em>init</em>).

The commands service and systemctl are related to <em>System V init</em> and <em>systemd</em>, respectively, and can list the status of a program.

Thus, the command service can list if MySQL is running on Linux using the piece of code in the question: <em>sudo service mysql status</em>.

Likewise, the command systemctl can activate and deactivate services, and, among many other functionalities, list the status of a program (like the one in the question: <em>systemctl status mysql</em>).

The command ps (process status) "displays information about a selection of the active processes" [<em>ps</em> man page]. The command has many options, and some are -e (select all processes) and -f (full-format listing). In this case, the command output is <em>piped </em>to grep (global regular expression print) command to find those processes mainly related to 'mysql'.

It is important to remember that command <em>sudo</em> (superuser do) permits a user to "execute a command as the superuser or another user" [<em>sudo</em> man page], since commands <em>service</em> and <em>systemctl</em> require privileges to be run, for security reasons.

6 0
3 years ago
The _____ is the area in Microsoft Excel where you can perform file commands such as Save, Open, and Print
Arlecino [84]
The BACKSTAGE VIEW is the area in Microsoft where one can perform file commands such as save, open and print.
The backstage view can be found under the file tab in the excel window. It has many options available and they include the following:info, new, open, save, save as, print, share, export and close. These options give the user the opportunity to perform desired functions on their workbook.
8 0
3 years ago
What feature is available to add a suggestion in the margin of someone else's document?​
Ksenya-84 [330]

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

The correct question is:

what feature is available to add a suggestion in the margin of someone else's document. The given features in this question are:

  • Annotation
  • Comments
  • Highlight and
  • Bookmark

The correct answer to this question is the Comments.

Because you can add comments in someone else's document and only Comments features in word document allow you add comments on the someone else's document.

While the other options are not correct because:

The Annotation works with grammar or writing, Highlight feature allows you to mark important information or text in your document. while Bookmark allows you to save your space in a document.

4 0
2 years ago
According to your text, three factors are responsible for the rapid rise in new product development. They are faster and more ec
gregori [183]

Answer:

Mass production.

Explanation:

The traditional factors of production are land, labour, capital and entrepreneurship. These factors are considered in product development, and are invested upon by the entrepreneur.

But as technology evolved, it has modified and enhance these factors. The product are easily transported with fast and economic transportation medium, communication between production lines are fast, cheap and of good quality and products are produced in mass.

8 0
3 years ago
define a function named quarter_num that has one parameter number and return quarter of the number. For example: if we called th
IgorLugansk [536]
Idk what programming language you use so

private int quarter_num(int num) {
return num / 4;
}
3 0
2 years ago
Other questions:
  • Exposing employee and customer personal data to an untrusted environment is an example of:
    9·1 answer
  • What event in the 1970s contributed to the current
    6·2 answers
  • If you are working on a document and want to have Word automatically save the document every minute, what steps should you use t
    13·1 answer
  • A word object in an excel worksheet to activate the word features
    9·1 answer
  • A keyboard is a/an _____. interconnector port packet NAS
    7·1 answer
  • What are the five types of alignment in Word?
    12·2 answers
  • This program will output a right triangle based on user specified height triangleHeight and symbol triangleChar. (1) The given p
    14·1 answer
  • Mika forgot to put in the function name in his function header for the code below. What would be the best function header?
    12·2 answers
  • c) If you are at foreign country visit, which banking card would you prefer to keep with you during visit (Debit Card or Credit
    10·1 answer
  • Where is the element coded in a web page.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!