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
Elodia [21]
3 years ago
11

Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "non-negative" otherwise. Ex:

If userVal is -9, out
Computers and Technology
1 answer:
ArbitrLikvidat [17]3 years ago
8 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 

 System.out.print("Enter a number: ");

 int userVal = input.nextInt();

 

 String aString;

 if(userVal < 0)

     aString = "negative";

 else

     aString = "non-negative";

     

 System.out.println(aString);

}

}

Explanation:

Ask the user to enter a number and set it to userVal

Check the value of userVal. If it is smaller than 0, set the string as "negative". If it is not, set it as "non-negative"

Print the string

You might be interested in
You are troubleshooting network connectivity issues on a workstation. Which command would you use to request new IP configuratio
kolezko [41]

Answer:

ipconfig / release command will be used to request new IP configuration information from a DHCP server

Explanation:

The ipconfig /release sends a DHCP release notification to the client so that the client immediately releases the lease henceforth updating the server's status information . This command also mark the old client's id as being available. Thus, the command ipconfig /renew then request a new IP address.

4 0
3 years ago
Headphones are an example of _____.
katen-ka-za [31]
The Answer Is An Output Device 


3 0
3 years ago
Read 2 more answers
Advantages &amp; Disadvantages of flow chart​
viktelen [127]

Answer:

Advantages of flow charts:

1. Communication where flowcharts are a more effective technique of explaining a system's rationale to all parties involved.

2. Efficient interpretation by using a flowchart, a problem can be investigated more effectively, resulting in lower costs and less time wasted.

3. Appropriate documentation such when program flowcharts serve as good documentary evidence, that is required for a variety of objectives, allowing things to run more smoothly.

4. Effective Coding where during the systems analysis and software development phases, the flowcharts serve as a guide or blueprint.

5. Practical Debug where the flowchart assists with the debugging process.

6. Efficient Program Maintenance by using a flowchart, it is simple to maintain an operational program. It allows the programmer to focus his efforts more effectively on that section.

Disadvantages of flow charts:

1. Manual traceability is required to ensure the accuracy of the flowchart drawn on paper.

2. Simple changes to the problem reasoning may necessitate a complete redo of the flowchart.

3. Displaying many branches and looping in flowchart is challenging.

4. When dealing with a complicated project or algorithm, the flowchart becomes very challenging and imprecise.

5. It can take some time to modify a flowchart.

3 0
2 years ago
Which key should you press to change the cell contents to your typed data
Free_Kalibri [48]

You can edit the contents of a cell directly in the cell. You can also edit the contents of a cell by typing in the formula bar.

When you edit the contents of a cell, Excel is operating in Edit mode. Some Excel features work differently or are unavailable in Edit mode.

4 0
3 years ago
Read 2 more answers
nswer the following questions concerning chapter 1:1.1 Which pair of layers are NOT peer layers?a.Transport layer in the sender
frosja888 [35]

Answer:

b.Transport layer in the sender and application layer in the receiver

Explanation:

A peer layer communication is usually used to describe the interactions of different layers among one another in the presence of system communication. If there is a single system, there will be approximately two neighboring layers such that one layer is below while the other is above. Therefore, the answer is option b.

8 0
3 years ago
Other questions:
  • What are the advantages and disadvantages of using thermoset plastics
    14·1 answer
  • Suppose you are consulting for a bank that's concerned about fraud detection, and they come to you with the following problem. T
    13·1 answer
  • What is obtained after processing data?​
    8·1 answer
  • Jasper and Samantha are in a robotics competition. The guidelines state that the robots should be able to move a 10-gram weight
    9·1 answer
  • If a fuse block or holder has tree fuses, it may be termed a...
    7·1 answer
  • What is the amount of work you must input in order to move the stone?
    13·1 answer
  • Text that is positioned at the top of a column and labels the<br> column.
    7·1 answer
  • 4. Write technical term for the following statements
    15·2 answers
  • How do I give Brainliest?? I'll give brainliest...
    13·2 answers
  • Which program assesses and measures improper medicare fee-for-service payments (based on reviewing selected claims and associate
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!