help me with those parts plz . (10) Evaluate the following Boolean expressions (
ID: 3903627 • Letter: H
Question
help me with those parts plz
. (10) Evaluate the following Boolean expressions (True or False) - 3) 5.9 -- 5.6s (6.3/4> 4 11 20 / 6 4 966 34532 324 > 293 3. (10) Evaluate each of the following expressions. Values without a decimal point are integers, values with a decimal point are real numbers. Show the value of each expression to the right of the que 22 / 44 * (34 & 31) 6. (10) What is the output of the code segment below (show answer in space to right)? double a = 9.5; while (a-- > 0) System.out.print (a + " "); a--;Explanation / Answer
4)
a. The expression 5%9 == 5 evaluates to TRUE(since 5%9 = 5 and 5==5 is TRUE)
The expression 6 * 3 / 4 > 4 || 20 / 6 !=3 evaluates to FALSE
6 * 3 / 4 > 4 ===> 4>4 ---> FALSE
20 / 6 !=3 ===> 3!=3 ---> FALSE
Hence 6 * 3 / 4 > 4 || 20 / 6 !=3 = FALSE || FALSE = FALSE.
Expr : 5%9 == 5 && (6 * 3 / 4 > 4 || 20 / 6 !=3)
= TRUE && FALSE
= FALSE
b. 4<3 = FALSE
2==2 = TRUE
3>9 = FALSE
34532%324>293 = 188>293 = FALSE
So, 4<3||2==2&&3>9&&34532%324>293
= FALSE || TRUE && FALSE && FALSE
= FALSE || FALSE
= FALSE
5.
6 % 4 * 2.0 / 4 + 2 * 5 = (6 % 4) * (2.0/4) + 2*5
= 2 * 0.5 + 2*5
= 11.0
22/44 * (34 %31) = (22/44) * (34%31) [ since it is integer division , 22/44 = 0 ]
= 0 * 3
= 0
6.
The output is 8.5 6.5 4.5 2.5 0.5
PLEASE UPVOTE IF THE ANSWER WAS HELPFUL
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.