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
In this project, you will add a (self-proclaimed) priority attribute to xv6 processes. The priority does not actually do anythin
kondor19780726 [428]

Answer:

Priority programming is a process programming method based on priority. In this technique, the developer chooses the tasks to work according to priority, which is different from other types of programming, for example, a simple round-robin.

On UNIX and many other systems, higher priority values represent lower priority processes. Some of the systems, such as Windows, use the opposite convention: a higher number means a higher priority

<h3>Explanation: </h3>

Priorities can be dynamic or static. Static priorities are assigned during creation, while dynamic priorities are assigned according to the behavior of the processes while they are in the system. To illustrate, the planner could favor intensive input / output (I / O) tasks, allowing expensive requests to be issued as soon as possible.

Priorities can be defined internally or externally. Internally defined priorities make use of a measurable amount to calculate the priority of a given process. On the contrary, external priorities are defined using criteria beyond the operating system (OS), which may include the importance of the process, the type and sum of the resources used for the use of the computer, user preferences , trade and other factors such as politics etc.

i hope this is right lol

6 0
3 years ago
Which are guidlines for using themes? Check all that apply
Andreyy89

Answer: A. Using different cell styles can help you differentiate different types of data.

B. Fonts should be easily readable and of appropriate size.

D. Be consistent with themes across worksheets and workbooks.

Explanation:

A theme refers to the preset package that contains functionality details and graphical appearance.

The guidelines for using themes include:

• Using different cell styles can help you differentiate different types of data.

• Fonts should be easily readable and of appropriate size.

• Be consistent with themes across worksheets and workbooks.

Therefore, the correct options are A, B and D.

7 0
3 years ago
To save a document with a new name, click _______ in the navigation bar and enter a new filename.
cricket20 [7]
Click the save as button
3 0
3 years ago
Corinne would like to click on the link at the bottom of a Web page but she only sees the top portion of the page. She should __
IgorLugansk [536]
Corinne should scroll down to the bottom of the page to where she can see the link
7 0
3 years ago
Read 2 more answers
Which statement regarding hard drives is incorrect?
Veseljchak [2.6K]

Answer: I think the answer is

c. solid state drives are less expensive than magnetic hard drives

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • What Software is used to play,create, and modify audio and video files
    7·2 answers
  • In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
    9·1 answer
  • Which Of The Following Is A College Major For Which IT Courses Would Most Likely Be Required?
    9·1 answer
  • Modify the list according to the following: append the smallest value at the end of the list when all numbers in the list are ne
    14·1 answer
  • For what type of document would you use the landscape page orientation
    11·1 answer
  • Write a program that reads in a temperature value in °F. Create a function ConvertFahrenheit that takes that value as a paramete
    7·1 answer
  • Which of these is the largest?<br> terabyte<br> exabyte<br> gigabyte<br> kilobyte<br> PLEASE HELP
    5·1 answer
  • Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicatin
    15·1 answer
  • Choose the words that make the following sentence true.<br> Primary memory is
    5·1 answer
  • How many discussion posts must you complete to meet the Expectations of the replies category
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!