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
Ket [755]
3 years ago
10

Write an expression that executes the loop body as long as the user enters a non-negative number. Note: If the submitted code ha

s an infinite loop, the system will stop running the code after a few seconds and report "Program end never reached." The system doesn't print the test case that caused the reported message. Sample outputs with inputs: 9 5 2 -1 Body Body Body Done.
Computers and Technology
1 answer:
Mama L [17]3 years ago
8 0

In the program While loop is used. In the while loop it divides the userNum by 2 in each iteration and prints the value of userNum. The inputs and corresponding outputs are written in the explanation.

<u>Explanation</u>:

In the while loop it divides the userNum by 2 in each iteration and prints the value of userNum.

import java.util.Scanner;  

public class NonNegativeLooper

public static void main (String [] args)

Scanner scnr = new Scanner(System.in);  

//initialize the userNum with 9

int userNum = 9;

//Repeat the loop until the userNum is not negative

while (userNum>=0)

System.out.println(Body);

//Prompt the user to enter the usrNum again

userNum = scnr.nextInt();

System.out.println(Done.);

return;

You might be interested in
What type of maintenance is required of a computer’s power supply to ensure that it remains in working order?
True [87]
<span>d. Clean any dust or debris from the air vents in front of the fans.</span>
5 0
3 years ago
Read 2 more answers
What is &lt;html&gt;
ipn [44]

the opening tag for an HTML document

8 0
3 years ago
Read 2 more answers
which network component connects a device to transmission media and allows the device to send and receive messages?
krok68 [10]

Answer: Hello!

Network Interface Card (NIC)

Explanation:

Mark me brainest please. Hope I helped! Hope you make an 100%

-Anna♥

5 0
3 years ago
11)When, if ever, will the geometric average return exceed the arithmetic average return for a given set of returns?A) When the
grigory [225]

Answer: E. Never

geometric average return can NEVER exceed the arithmetic average return for a given set of returns

Explanation:

The arithmetic average return is always higher than the other average return measure called the geometric average return. The arithmetic return ignores the compounding effect and order of returns and it is misleading when the investment returns are volatile.

Arithmetic returns are the everyday calculation of the average. You take the series of returns (in this case, annual figures), add them up, and then divide the total by the number of returns in the series. Geometric returns (also called compound returns) involve slightly more complicated maths.

6 0
3 years ago
Write one line of code to print animals, an array of Animal objects.
oksian1 [2.3K]

Answer:

console.log(Animal);

Explanation:

The statement written above prints the array Animal which contains objects.There are two to three ways to print the array Animal in javascript. One of the method is written in the answer it prints the arrays in the console of the browser.

You can go to the console by pressing F12 and then clicking on the console.

Other methods to print are

  1. Simple write Animal after defining the array.
  2. Use alert.
  3. document.write()
7 0
3 years ago
Other questions:
  • Yan wants to attract customers specifically searching on Google for Time-B-Gone, his company's unique office-support product. Hi
    12·1 answer
  • The operations planning practice of inputting sales forecasts into computer software that accurately predicts the amount and tim
    6·1 answer
  • Which of the following correctly describes the reason for quality customer service?
    15·2 answers
  • Courteous behavior on the road will
    10·2 answers
  • Which of the following is the core of an operating system that maintains the computer’s clock, starts applications, and assigns
    5·1 answer
  • Select the characteristics that describe the evolution of computers that predate the personal computer (select all correct answe
    12·1 answer
  • What's another word for contact print?
    15·2 answers
  • Which graph is the solution to the system 2x – 3 and y &lt; 2x + 4?
    5·2 answers
  • What are the 3 dimension of an information system?
    13·1 answer
  • Explain briefly how learning how to follow can make a person a good leader
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!