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
Examine about the Internal &amp; External Fragmentation methods give an example for each. essay​
Tju [1.3M]

Internal Fragmentation occurs when a process needs more space than the size of allotted memory block or use less space. External Fragmentation occurs when a process is removed from the main memory. Internal Fragmentation occurs when Paging is employed. External Fragmentation occurs when Segmentation is employed.

3 0
3 years ago
¿Que es una linea del tiempo?
DanielleElmas [232]
Una línea donde vas ordenando los hechos que han sucedido hasta el presente, aquí te dejo un ejemplo

•___________________________•
P. N. E. HISTORIA
A. E. D
L. O. M
E. L
O. I
L. T
I. I
T. C
I. O
C
I
6 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
Pie

Answer:

Eveidence

Explanation:

<3

7 0
2 years ago
Read 2 more answers
2. Choose all of the correct answers for each of the following: [a] The relations of two sub-entity sets of the same super entit
Andrews [41]

Answer:

i say b

Explanation:

5 0
2 years ago
Font issues arise when you attempt to run a presentation on a computer that does not have the fonts you used when creating the p
jenyasd209 [6]

Some computers have fonts that differ from one another – it could be because the user downloaded a different font styles from the various sources available from the Internet; it could also be because the user is creating his or her presentation in a computer with different operating systems.

In order to mitigate any error that might occur in the font style due to these circumstances, you should embed the font to the presentation while creating it. This ensures that the same font displays across all system.

3 0
3 years ago
Other questions:
  • Write a main method that prompts the user for an integer between 1 &amp; 10 (inclusive). If the user enters an invalid number, p
    10·1 answer
  • Why is it important to explore an Integrated
    13·1 answer
  • Determine and prove whether an argument in English is valid or invalid. About Prove whether each argument is valid or invalid. F
    5·1 answer
  • There are several factors that can substantially affect the consumer search process. Match the factor with an example of how the
    5·1 answer
  • Which of the following is *not* true about logging user and program actions on a computer?
    10·1 answer
  • Which of the following reflects Moore's law? Multiple Choice The doubling of computer chip performance per dollar every two year
    11·1 answer
  • As a general rule, the number of bullet points on a slide should not exceed _____. a.2 b.4 c.8 d.10
    9·1 answer
  • To ensure rapid recovery and security of data, backup data should be ________.
    11·1 answer
  • The question is in the photo
    14·1 answer
  • question 1 scenario 1, question 1-5 you’ve just started a new job as a data analyst. you’re working for a midsized pharmacy chai
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!