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
#include
meriva

Answer:

wait what

Explanation:

6 0
2 years ago
Read 2 more answers
Figuring out why your computer won't turn on falls under diagnosing.<br> A. True<br> B. False
igomit [66]
The answer to your question, is true
hope this helps :D
7 0
3 years ago
Read 2 more answers
If a user’s current directory is /home/mary/project1, which command could she use to move to the etc directory directly under th
kykrilka [37]

Answer:

Option 4 is the correct answer to the above question.

Explanation:

In the Linux operating system, The etc folder is listed on the root directory. When any user wants to go in the root directory of the Linux operating system from anywhere, then he needs to follow the command of the name of the folder where he wants to go with the '/' symbols. The above question states that the user wants to go to the etc folder of the root directory, then he needs to press the command '/etc' with the help of cd command because cd command is used to open any folder. So the option 4 is the correct, while the other is not because--

  • Option 1 states about cd which gives the error.
  • Option 2 states about cd /home/mary/etc which take the user to the etc folder which is in the mary folder.
  • Option 3 states about the cd etc which is used to take the user on the etc folder which is in the current folder.
  • Option 5 states about the cd\etc which gives the error.
8 0
3 years ago
Lisa has a section of her document that she would like to include in the index. Which option should Lisa choose?
kupik [55]

Answer:

For including a part of the text within the index, you need to make use of the Mark Entry option. And here you can fill the required information for curating your index, you need to just follow the instruction as required, and you will be fine.

Explanation:

Please check the answer.

8 0
3 years ago
What two solutions address lack of human access to clean water
Marina86 [1]

Answer:

THREE strategies which local municipality is implementing in addressing the issue of lack of clean water caused by human factors include:

1) Increasing the amount of tax for those companies which are opening their wastes into water sources which can help built better water cleaning and recycle system.

2) Tree plantation is another strategy to help secure the water sources and naturally keep cleaning it.

3) Running awareness campaigns for general people to keep the water sources clean as well as use the only amount of water which they need and not waste it.

Explanation:

i hope this helps you

5 0
3 years ago
Other questions:
  • _______________ is the term for the convergence of real-time and non-real-time communications services such as telephony, instan
    11·1 answer
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • Why is updating your anti-virus a good thing?
    13·1 answer
  • 3. A vulnerability is: a. A hacker searching for open ports b. A known attack method c. An incorrectly implemented policy d. All
    7·1 answer
  • We have written a method called sum with an int[] parameter nums. We want our sum method to compute the sum of nums, but our cod
    5·1 answer
  • The LPN/LVN cares for an older client admitted to the hospital for treatment of a fractured femur. The LPN/LVN notes the client
    10·2 answers
  • Please help i will give you brainelst answer part B thank you!!!!!!!!!!!!!1
    13·1 answer
  • What is the correct term for a piece of malware that hides inside a legitimate software program or file from trusted sources
    8·1 answer
  • What is information technology ?​
    15·2 answers
  • Slide rule was an analog device invented by William oughtred in 1620 it is true or false​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!