The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 399 Weeks Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
1. Evaluate the following boolean expressions. For each of the following expressions, assume x is 10, y is 20, and z is 30. Indicate which of the following boolean expressions are always true and which are always false, regardless of the values for x, y, or z.
|
a. x < 10 || x > 10 b. x > y && y > x |
|
c. (x < y + z) && (x + 10 <= 20) d. z - y == x && Math.abs(y - z) == x |
|
e. x < 10 && x > 10 |
|
f. x > y || y > x |
|
g. !(x < y + z) || !(x + 10 <= 20) h. !(x == y)) && (x != y) && (x < y || y < x) |
Â
2. Express the following switch statement by using nested if statements.
|
switch (grade){ |
|||
|
case 10: |
|||
|
 |
case |
9: |
a = 1; |
|
 |
 |
b = 2; |
|
|
 |
 |
break; |
|
|
 |
case |
8: |
a = 3; |
|
 |
 |
b = 4; |
|
|
 |
 |
break; |
|
|
 |
default: |
a = 5; |
|
|
 |
 |
break; |
|
|
} |
 |
 |
|
Â
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- Th-----------ank----------- Yo-----------u f-----------or -----------usi-----------ng -----------our----------- we-----------bsi-----------te -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill-----------