answer.
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
babymother [125]
2 years ago
14

Write an expression that executes the loop while the user enters a number greater than or equal to 0.Note: These activities may

test code with different test values. This activity will perform three tests, with userNum initially 9 and user input of 5, 2, -1, then with userNum initially 0 and user input of -17, then with userNum initially -1. See "How to Use zyBooks". .Also note: If the submitted code has 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:
Lena [83]2 years ago
5 0

Answer:

       do {

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

           userNum = in.nextInt();

           System.out.println("You entered "+userNum+" you are still in the loop");

       }while(userNum>=0);

Explanation:

  • In this solution in Java programming language a do.....while loop has been used to implement it
  • The condition while(userNum>=0); ensures that the user will continuously be prompted to enter a number as long as the number entered is greater or equals to 0.
  • See a complete program below That uses the scanner class and countinually prompts the user for input as long as the number entered is greater or equal to zero
  • The loop breaks once a number less than zero is entered by the user

<em>import java.util.Scanner;</em>

<em>public class num3 {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        int userNum;</em>

<em>        do {</em>

<em>            System.out.println("Enter a number");</em>

<em>            userNum = in.nextInt();</em>

<em>            System.out.println("You entered "+userNum+" you are still in the loop");</em>

<em>        }while(userNum>=0);</em>

<em>        System.out.println("You are out of the loop now.... goodbye");</em>

<em>    }</em>

<em>}</em>

You might be interested in
What is the statement describing? Agile team continuously adapt to new circumstances and enhance the methods of value delivery
Vera_Pavlovna [14]

Answer:

Continuous Integration

Explanation:

In continuous integration process, A program or piece of code is edited, tested and validated by team of software developers or contributors to complete and deploy the single project. This practice will improve the quality and reliability of the code.

Improvement, delivery and deployment are the three different phases, to complete the process of continuous integration.The individuals who contribute in a code or program  in terms of improvement, delivery and deployment make a team that leads to continuous integration.

So, Agile team Continuously adapt Continuous Integration to new circumstances and enhance the methods of value delivery.

8 0
2 years ago
Susie works for an architectural firm and the partners have always drawn the plans for projects by hand. Though Susie learned ho
lidiya [134]

Answer:

The correct answer to the following question will be CAD.

Explanation:

CAD - It stands for Computer-aided Design. CAD is a software used for creating some 3D designs, creative drawing or some technical illustrations and is basically used by the engineers and artists.

Many projects based on electronic can be designed with the help of this software, electronic parts like circuit boards, etc.

Various types of CAD are as follows :

  • 2D (Two dimensional)
  • 3D (Three dimensional)
  • 3D wire frame
  • Solid modeling

This enables efficiency in design's quality, also increase in engineer and artist's productivity. So, many of the computer programs should recommend the Computer-aided design software to there project partners for some 3D and effective look on their project.

3 0
2 years ago
Which of the following is not one of the four criteria for evaluating websites?
Flura [38]

Answer:validity

Explanation:

Because it dont sound right

5 0
2 years ago
When using preventative insecticides which holiday period should trigger an application?
Savatey [412]
Spring break around Easter I would believe
4 0
2 years ago
Read 2 more answers
If you have long column labels with columns so wide that they affect the readability of a worksheet, you should first
Anon25 [30]
You can format the columns for a certain width or you can use format cells, word wrap.
3 0
2 years ago
Other questions:
  • Darcy is creating an instructional manual for her employees. She entered the text in a word processing program and wants to impo
    6·1 answer
  • Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year
    13·2 answers
  • Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
    14·2 answers
  • Translate each of these statements into logical expressions using predicates, quantifiers, and logical connectives. a) Something
    7·1 answer
  • The Windows ________ is a hierarchical database that stores system configuration information. It maintains files used to control
    15·1 answer
  • 4. When emergency changes have to be made to systems, the system software may have to be modified before changes to the requirem
    13·1 answer
  • Write a program that plays a reverse guessing game with the user. The user thinks of a number between 1 and 10, and the computer
    5·1 answer
  • Assume you have a variable, budget, that is associated with a positive integer. Assume you have another variable, shopping_list,
    11·1 answer
  • Select the correct answer.
    6·1 answer
  • If Maya wants to access a view that would control multiple slides within a presentation, which view should she utilize? Master v
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!