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
Operating system software allows you to use your fingers, a mouse or other pointing device to select screen controls, such as bu
bagirrra123 [75]
Operating system (OS)<span> software allows you to use your fingers, a mouse or other pointing device to select screen controls, such as buttons and scroll bars or pictures, also called Resource Manager.  </span><span>Operating System manages all the Resources like Memory and Processor and all the Input output Devices, it manages all the Resources of the System. </span>
5 0
3 years ago
Read 2 more answers
Fill in the blanks : To store 3 character a computer occupies...................bytes memory space​
wariber [46]

Answer:

Umm was there supposed to be a picture????

Explanation:

Hope you have a wonderful Christmas Eve time with your family!!❄️

5 0
3 years ago
Read 2 more answers
The idea generating technique most often used in writing business letter is ?
aivan3 [116]
Hihi!

The correct answer is free writing! Free writing <span>is a prewriting technique in which a person writes continuously for a set period of time without regard to spelling, grammar, or topic! People tend to use it because it produces raw, often unusable material, but helps </span>writers<span> overcome blocks of apathy and self-criticism!</span>

I hope I helped!
-Jailbaitasmr
6 0
4 years ago
Read 2 more answers
Would anyone know this
Darina [25.2K]
Time in transit would be correct
5 0
3 years ago
Read 2 more answers
When memory allocation is ____, it means all portions of the program and OS are loaded into sequential locations in memory.
OLga [1]

Answer:

Contiguous

Explanation:

A Contiguous memory allocation is known to be a classical memory allocation model. In this situation, we have a system which assigns consecutive memory blocks to a process. It is one of the oldest methods of memory allocation. If the process is in need of execution, the memory would be requested by the process. The processes size would then be compared to the amount of Contiguous memory that is available for the execution of the process.

3 0
3 years ago
Other questions:
  • Which port can connect you to the Internet through a telephone line?
    6·1 answer
  • What is the purpose of inserting SmartArt in a Microsoft Office program? (1 point)
    11·2 answers
  • . Dеclarе a onе-dimеnsional array of 30 doublеs (on thе stack) namеd rainfall
    11·1 answer
  • A style manual can be described as
    11·2 answers
  • Which of the following scenarios is an example of irrelevant media?
    11·1 answer
  • What can be the maximum possible length of an identifier 3163 79 can be of any length​
    5·1 answer
  • Write a program to find the sum of first 10 even numbers in qbasic​
    15·1 answer
  • Difference between Data and information​
    10·1 answer
  • What technology does kroger’s edge technology and amazon’s just walk out technology leverage?.
    15·1 answer
  • Missing appropriate security hardening across any part of the application stack or improperly configured permissions is an examp
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!