subject

Consider the following code segment:

if (value > 0)

System. out. println("positive");

if (value < 0)

System. out. println("negative");

if (value == 0)

System. out. println("neither");

Rewrite the code in the space below so that it uses an if-else structure instead of 3 if statements.

IM struggling does anyone know how to do this

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
Assume that you have an array of integers named a. which of these code segments print the same results? int i = 1; while(i < a.length) { system.out.println(a[i]); i++; } int i; for (i = 0; i < a.length; i++) { system.out.println(a[i]); } for (int i : a) { system.out.println(i); } i and ii only ii and iii only i and iii only all three print the same results. all three print different results.
Answers: 3
question
Computers and Technology, 22.06.2019 11:30
What do character formats do for your document's message? a.set the tone b.provide organization c.provide clarity d.set how texts align with documents
Answers: 2
question
Computers and Technology, 22.06.2019 15:30
When creating a budget, log fixed expenses before income. after income. after savings. at the top.
Answers: 1
question
Computers and Technology, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
You know the right answer?
Consider the following code segment:

if (value > 0)

System. out. println...
Questions
question
Mathematics, 30.04.2021 01:20
question
Mathematics, 30.04.2021 01:20
question
Chemistry, 30.04.2021 01:20
question
Mathematics, 30.04.2021 01:20
Questions on the website: 13722361