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
Computers process information consistently for all transactions. This creates a risk that:______
Anna007 [38]

Answer:

b. erroneous processing can result in the accumulation of a great number of misstatements in a short period of time.

Explanation:

Because of the consistent nature of processing in computers, this is capable of creating certain kinds of risk. From the option, one of the probable risk that can result from consistent information processing for multiple transactions at the same time is erroneous processing. This can therefore lead to a pile of misstatements in only a short period of time.

6 0
3 years ago
What is the purpose of the SMTP command "HELO"
sergij07 [2.7K]
If a client initiates the SMTP communication using an EHLO (Extended Hello) command instead of the HELO command some additional SMTP commands are often available. They are often referred to as Extended SMTP (ESMTP) commands or SMTP service extensions. Every server can have its own set of extended SMTP commands.
4 0
3 years ago
_______________involves engineers building up a 3D geometry piece by piece.
zloy xaker [14]

Answer:

<u>Parametric design</u> involves engineers building up a 3D geometry piece by piece. 2D sketches turn into 3D features, with constraints and relations duly applied to fit the designer's intent.

Explanation:

Hope this helps

8 0
2 years ago
Write a program that has two variables, start and end which represent beginning and end of segment, including start and end, whi
mr_godi [17]

The program illustrates the concepts of loops and conditional statements.

<h3>The complete program</h3>

The program written in Python, where comments are used to explain each line is as follows:

start = int(input())

end = int(input())

for i in range(start, end+1):

    if i%3 == 0 and i % 6 !=0:

         print(i,end = " ")

Read more about python programs at:

brainly.com/question/13246781

#SPJ1

4 0
2 years ago
A hammer has an input distance of 2 cm and an output distance of 7 cm. What is its ideal mechanical advantage?
KATRIN_1 [288]

Answer: 4

What is its ideal mechanical advantage?

Explanation:

6 0
2 years ago
Other questions:
  • To avoid potential documentary errors and security leaks, the configuration of firewalls should not be documented unless strictl
    5·1 answer
  • using C++ to sort user input. for example, user enter 25numbers and sort them from small to big or big to small, cout thesamlles
    6·1 answer
  • Who is the founder of javascript? ​
    14·2 answers
  • When does information become a liability for an organization
    6·1 answer
  • You are contacted by a project organizer for a university computer science fair. The project organizer asks you to hold a forum
    10·1 answer
  • Convert the following hexadecimal numbers to decimal: (a) FF (b) F0A2 (c) 0F100 (d) 100
    10·1 answer
  • What is wrong with this code and correct it.
    12·1 answer
  • State four features of information​
    5·1 answer
  • When must an Assured Equipment Grounding Conductor Program (AEGCP) be in place?
    13·1 answer
  • Consider the following code using the posix pthreads api:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!