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
KonstantinChe [14]
3 years ago
7

Rewrite each condition below in valid Java syntax (give a boolean expression): a. x > y > z b. x and y are both less than

0 c. neither x nor y is less than 0 d. x is equal to y but not equal to z
Computers and Technology
1 answer:
Natali5045456 [20]3 years ago
4 0

Answer:

The boolean expression is the expression which can be evaluated to true or false. This true/false is called boolean value. An if statement is used to check a condition which often contains the boolean expression which can either evaluate to true or false.

<h2>a. x > y > z </h2>

This line means that the value of variable x is greater than the value of variable y and the value of variable y is greater than the value of variable z.

This means:

                            x is greater than y AND y is greater than z

                                                     x > y AND y > z

in JAVA                                         x > y && y > z

using if statement                        if(x > y && y > z)

it can also be written as:       if (x > y && x > z && y >z)

<h2>b. x and y are both less than 0</h2>

This statement means that the value of variable x and the value of variable y are less than 0

This means:                                   (x AND y) = 0

in JAVA                                          (x&&y)==0

using if statement:                 if ((num&&hum)==0)

This can also be written as       x < 0 AND y < 0

 In JAVA                                         x  < 0 && y < 0

using if statement                       if (x < 0 && y < 0)

<h2>c. neither x nor y is less than 0</h2>

This statement means that neither the value of x variable nor the value of y variable is less than 0. This clearly means that the value of x and value of y both values are greater than or equal to 0.

this means:

                                                 x > = 0 AND y > = 0  

In JAVA                                      x > = 0 && y > = 0

Using if statement                     if(x > = 0 && y > = 0)

It can also be written as                    (x && y > = 0)

                                                         if(x && y > = 0)

<h2> d. x is equal to y but not equal to z</h2>

This statement means that the value of x is equal to the value of y but the value of x is not equal to the value of z.

This means

                                                         x = y but x ≠ z

                                                         x=y AND x≠z

In JAVA                                              x==y && x!=z

Using if statement                           if (x == y && x != z)

it can also be written as                    if (x == y && y != z)

If x is equal to y so this means that the value of x and y will be the same and both the values will not be equal to the value of z.

You might be interested in
What does the following code do? Assume list is an array of int values, temp is some previously initialized int value, and c is
stellarik [79]

Answer:

<h2><em>The folowing code counts the number of elements in list that are less than temp.</em></h2>

Explanation:

<em>Because an array is an object that stores many values of the same type. An array element is one value in array. An array index is an integer indicating a position in an array. Like strings, arrays use zero base indexing, that is array indexes start with 0(zero).</em>

8 0
3 years ago
Identifying the Property for Setting Page Breaks
denpristay [2]

Answer: A) The force new page property

3 0
3 years ago
A program virus infect​
Darya [45]

Explanation:

Once a virus has successfully attached to a program, file, or document, the virus will lie dormant until circumstances cause the computer or device to execute its code. In order for a virus to infect your computer, you have to run the infected program, which in turn causes the virus code to be executed.

MARK AS BRAINLIST IF IT IS USEFUL

7 0
3 years ago
What time is spellrd the same forwards and backwards​
Juliette [100K]
12:21 is the correct answer
6 0
3 years ago
Help me this questions I will Brainly the one who correct them all .
Eddi Din [679]
Nice question will answer wait
7 0
4 years ago
Other questions:
  • Jake and Sarah have an assignment of writing the history of American independence as a team. They divided their work in hait and
    7·2 answers
  • What is a organisation in office technology
    7·1 answer
  • The process of sending ping requests to a series of devices or to the entire range of networked devices is called a:
    9·1 answer
  • Step 1: Configure the initial settings on R1. Note: If you have difficulty remembering the commands, refer to the content for th
    10·1 answer
  • Database applications are seldom intended for use by a single user.
    15·1 answer
  • What happens if i unplug my alarm system?
    11·1 answer
  • How do computers benefit individuals' health care?
    10·1 answer
  • Importance of professional education​
    15·1 answer
  • Which of the following is an advantage of computer usage? *
    10·1 answer
  • How have the computers contributed in the banking ?<br>​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!