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]
4 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]4 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
Name the contributory components that are considered when determining an E/M code; they are not considered key components:
Vika [28.1K]

Answer:

time

Explanation:

E/M code is known as the evaluation and management code. The E&M code may be defined as the medical coding system which supports the medical billing process.  Every new patient is assigned a E/M code. The components that are not considered for determining the E/M code are coordination of care, the counselling, time and the nature of presenting problem.

7 0
3 years ago
What is redundancy? What problems are associated with redundancy?
Anarel [89]

Answer:

Redundancy is the mechanism that occurs in database's data as the same data is stores in the multiple location.It creates repeated data by accident or for backup purpose.

The issues that arise due to the redundancy of the data is the storage space in database gets consumed and thus wastes the space in storing information in multiple locations.When any update occurs in the stored data's field value , it also has to be changed in the multiples occurrences.

5 0
4 years ago
When solving a problem in a group situation, which of the following traits should be demonstrated?
kakasveta [241]

Answer:

compromise should be demonstrated

8 0
3 years ago
An important piece of a project is past due date.
bixtya [17]
Budget and time is the answer
4 0
3 years ago
Read 2 more answers
Not all output display data for humans to read explain why​
Vadim26 [7]

Answer:

The eye has a very focused view that is optimised for perceiving movement.Human cannot see clearly outside an -5 degree cone of foveal vision.

8 0
3 years ago
Other questions:
  • Which argument forces a writer to return to and change the input before resolving a “UnicodeError”?
    10·1 answer
  • Pressing the Ctrl+Home keys moves the insertion point to the
    12·2 answers
  • Which of the following is the most effective password?
    15·2 answers
  • To computer the equivalent units of production, add: A. units completed plus a percentage of the beginning WIP units B. units co
    10·1 answer
  • In ____________, a large address block could be divided into several contiguous groups and each group be assigned to smaller net
    7·1 answer
  • The ____ object can trigger a selectedindexchanged event when a selection is made
    5·1 answer
  • Write, compile, and test a program named PersonalInfo that displays a person's name, birthdate, work phone number, and cell phon
    5·1 answer
  • Every telecommunication setup uses two devices: one device to transmit data and one device to receive data. Which device transmi
    15·1 answer
  • Computer science is a blank process
    6·2 answers
  • Which of these would be the best way to inform an employee that they are losing their job?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!