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
It is safe to stand on the top step of a ladder provided it is braced property
Eduardwww [97]

there are many factors to weather or not it is 100% "safe", but if it is stable and you have good balence I would say yes.

7 0
4 years ago
1) Coding for Table in Html<br>​
poizon [28]

See below for the code in HTML

<h3>How to code the table in HTML?</h3>

The given table has the following features:

  • Tables
  • Cell merging
  • List (ordered and unordered)

The HTML code that implements the table is as follows:

<table border="1" cellpadding="1" cellspacing="1" style="width:500px">

<tbody>

 <tr>

  <td colspan="1" rowspan="2"><strong>IMAGE</strong></td>

  <td colspan="1" rowspan="2"><strong>name</strong></td>

  <td colspan="2" rowspan="1"><strong>first name</strong></td>

 </tr>

 <tr>

  <td colspan="2" rowspan="1"><strong>last name</strong></td>

 </tr>

 <tr>

  <td>DOB</td>

  <td>yyyy</td>

  <td>mm</td>

  <td>dd</td>

 </tr>

 <tr>

  <td>Qualifications</td>

  <td colspan="3" rowspan="1">references</td>

 </tr>

 <tr>

  <td>

  <ol>

   <li>&nbsp;</li>

   <li>&nbsp;</li>

   <li>&nbsp;</li>

   <li>&nbsp;</li>

  </ol>

  </td>

  <td colspan="3" rowspan="1">

  <ol type = "a">

   <li>&nbsp;</li>

   <li>&nbsp;</li>

   <li>&nbsp;</li>

   <li>&nbsp;</li>

  </ol>

  </td>

 </tr>

</tbody>

</table>

<p>&nbsp;</p>

Read more about HTML at:

brainly.com/question/14311038

#SPJ1

3 0
2 years ago
When adjusting the aperture, an F-stop of F32 lets in more light then a setting of F8
Basile [38]
False The higher the f-stop number, the smaller the aperture so less light will enter the camera.making that statement false
8 0
3 years ago
Describe at least two other companies that are direct or indirect competitors to your company. Explain how you will differentiat
umka2103 [35]

I need to know more about your company to help you answer this question


4 0
3 years ago
What is an administrator?
Drupady [299]
A person responsible for running a business, organization, etc.
3 0
3 years ago
Other questions:
  • Which of the following statements is false? a. Each object of a class shares one copy of the class's instance variables. b. A cl
    11·1 answer
  • A service provider, hardware, and web browser are needed to connect to __________.
    8·2 answers
  • Sam needs to create a spreadsheet for his coworkers. They will need to follow a crossed a long road of data. Sam would like to m
    15·1 answer
  • 2. From the listing code, please give the block of line numbers for code which are concerned with the following: A) Main functio
    5·1 answer
  • Write a loop to print 10 to 90 inclusive (this means it should include both the
    10·1 answer
  • Discuss the difference between a broad internet search and a narrow internet search?
    12·2 answers
  • Brainliest for whoever adds me on snap<br> gianavaughn007
    15·2 answers
  • What is the gear ratio?
    12·1 answer
  • Generalized goals are more likely to be achieved than specific goals. True or False
    7·1 answer
  • If u play codm pls tell me ur username
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!