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]
3 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]3 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
You cannot then move and resize the control on the form as desired with your mouse TRUE OR FALSE​
Sindrei [870]

Answer:

False

Explanation:

4 0
2 years ago
Read 2 more answers
.Write a C++ program that displays your name and address (if you value your privacy, a fictitious name and address).
olga_2 [115]

Answer:

#include <iostream>

using namespace std;

int main() {

   cout<<"My name is Rajat Sharma"<<endl<<"My address is Flat no=23 GH=5 Paschim Vihar New Delhi 110087 India"<<endl;

return 0;

}

Explanation:

The program is written in C++ language.In the program I have used cout to print my name and the address.First the name will be printed then the address in the new line endl is used for new line.To print any sentence just put them in double quotes.The same sentence in the program will be printed on the screen.

5 0
3 years ago
Write a program that has a conversation with the user. The program must ask for both strings and numbers as input. The program m
konstantin123 [22]

Answer:

yo im sorry eat my cookie

Explanation

doorkoeeworkwoeroewkrwerewrwe

5 0
3 years ago
What does a "swivel chair" work task involve?
nadezda [96]

Answer:

An employee literally swings from application to application to accomplish the laborious task of manually copying information from one application, validating it, and pasting it in another application. In applying human judgment and decision making: Entering data multiple times into different applications. Ensure that complex information obtained from an application is accurate. Communicate physicallly with a group of people simultaneously.

Explanation:

4 0
2 years ago
If an if- else statement is true, it will include which kinds of results?
Salsk061 [2.6K]

In an if...else statement, if the code in the parenthesis of the if statement is true, the code inside its brackets is executed. But if the statement inside the parenthesis is false, all the code within the else statement's brackets is executed instead.

Of course, the example above isn't very useful in this case because true always evaluates to true. Here's another that's a bit more practical:

#include <stdio.h>

int main(void) {

int n = 2;

if(n == 3) { // comparing n with 3 printf("Statement is True!\n");

}

else { // if the first condition is not true, come to this block of code

printf("Statement is False!\n"); } return 0;

}

Output:

Statement is False!

5 0
3 years ago
Other questions:
  • Successful Web sites such as StumbleUpon ( www.stumbleupon) and Digg ( www.digg) use ____ by inviting their visitors to vote on
    8·1 answer
  • Dayla is concerned about managing her digital footprint. What does she mean by this? *
    7·1 answer
  • Jim is writing a program to calculate the wages of workers in a teddy bear factory.
    7·1 answer
  • Riya wants to save her project work in an external device so that she can show it to her class teacher. Help her to choose the d
    13·2 answers
  • The term "exception propagation" means:
    5·1 answer
  • Emma lives in Pennsylvania, what climate does she live in?
    7·1 answer
  • What is the limitation of computer<br>​
    5·1 answer
  • Which part of the brain controls the movement of muscles​
    6·1 answer
  • Which of the following boxes should replace question mark
    8·1 answer
  • are you in active recovery from a substance use disorder (addiction)? active recovery is defined as being free from an alcohol o
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!