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
Anuta_ua [19.1K]
4 years ago
14

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.
Computers and Technology
1 answer:
madam [21]4 years ago
3 0

Answer:

           while (Num>=0) {

               System.out.println("enter a another number");

               Num = in.nextInt();

           }

Explanation:

The complete java code prompting a user to enter a number until a negative number is entered is given below:

import java.util.Scanner;

public class num6 {

public static void main (String [] args) {

Scanner in = new Scanner(System.in);

System.out.println("enter a number");

int Num = in.nextInt();

while (Num>=0) {

System.out.println("enter a another number");

Num = in.nextInt();

}

System.out.println("Done.");

return;

}

}

You might be interested in
Help please appreciate it
Lelechka [254]
D you can change the text box size if you need to include more text
3 0
3 years ago
Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive.
zysi [14]
Procedure SumEvenOdd(stdin: array [0..100] of integer)
var
   i, sum_even, sum_odd: integer;

begin
   for i := 0 to 100 do begin
       if stdin[i] < 0 then
           break;
       if stdin[i] mod 2 = 0 then //even number
          sum_even := sum_even +  stdin[i]
       else 
          sum_odd := sum_odd +  stdin[i]; 

       ShowMessage('sum of even is ' + IntToStr(sum_even) + ' ' + 'sum of odd                                  is' + IntToStr(sum_odd) ) ;
   end; 

end
5 0
4 years ago
Help please, on tuesday we have oral presentation in zoom and i am afraid to speak in front of people, and i don't know what to
Lapatulllka [165]

Answer:

You should be strong, and be sure about what you want to say. Make sure when you speak it is clear, and makes sense.

Explanation:

If you don't speak up or sound like you know what you are talking about. I like to think of it as dancing. Act like you own the stage, or in your case, like you own the presentation. Also, I suggest you speak to your teacher in private, about him ignoring you. If I were you, I would look for newer friends. Ones that won't ignore you.

6 0
3 years ago
A _____ consists of a group of programs that manipulate the database and provide an interface between the database and its users
saveliy_v [14]

Answer:

DATA MANAGEMENT SYSTEM

Explanation:

Data management system is a program for storing and retrieving users data thereby allowing the users to create their own database.

The database management system also interacts with end users, applications, and the database itself to capture and analyze the data and also provide an interface between the database and its users and other application programs.

6 0
3 years ago
Int x = 25;
Olin [163]

Answer:

printer

Explanation:

4 0
3 years ago
Other questions:
  • (GAME DESIGN)
    15·1 answer
  • A(n) _____ of an class is where the services or behaviors of the class is defined. (Points : 6) operation
    6·1 answer
  • What is an ISP?<br> in computer Networking
    11·2 answers
  • What is the output of the following code fragment? int i = 1; int sum = 0; while (i &lt;= 15) { sum = sum + i; i++; } System.out
    5·1 answer
  • On the piano, the pitches/notes used on the bass clef are located on what part of the keyboard?
    9·2 answers
  • During which phase of film making does the team outline their vision for the film?
    5·1 answer
  • How Do I Make A Walk animation for a school Project?? Gifs?
    13·1 answer
  • What are workplace human relations
    10·1 answer
  • Daniel has a list of numbers that are not in any order. He wants to find the order of the numbers with the help of a spreadsheet
    10·1 answer
  • Mark just finished reading the cay and must write a book report comparing events in the book to events in his life. based on eac
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!