JAVA
Given boolean variables x, y, and z, rewrite each of the
following conditional statements as the simplest single statement
that does not use a conditional.
Where necessary, use the relational operators == (equals) and !=
(not equals), and the logical operators && (and), || (or),
and ! (not).
c) (2 marks) if (x) y = false; else y = true;
d) (2 marks) if (x) return y; else return false;
e) (2 marks) if (x) y = z; else y = !z;
JAVA Given boolean variables x, y, and z, rewrite each of the following conditional statements as the simplest single st
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am