Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

OOD LUCK Assume all variable are properly declared and all programs are complete

ID: 3870878 • Letter: O

Question


OOD LUCK Assume all variable are properly declared and all programs are complete. ID You are not allowed to use computer to run the programs 1. Show the printout of the following code: (write the printout next to each p println statement is executed in the program) a. Show the output of the following code: public class Example rintin statement if the Point 1 public static void main(Stringll args) System.out.printIn("45 + 43 % 5 * (23 * 3 % 2) = " + (45 + 43 % 5 * (23 * 3 % 2))); System.out.printIn('' 3%5 + 4 /5 + 7 / 9-" + (3%5 + 4 /5 + 7 I 9)); ll ll Point 1 b. Determine whether the following expressions evaluates to true or false. public static void main(Stringll args) f 15, y=10, z=22; public class Test ( int x = System.out.printIn('' !(x=z) (z-2 != 20)= +(!(K y2)&&(v> z) ll (n! 20 )));

Explanation / Answer

Here is your answers:

Answers 1:

Output of question 1 will be:

45+43%5*(23*3%3)=48
3%5+ 4/5+7/9=3

Reason: Here in question it is  System.out.println("45+43%5*(23*3%3)="+(45+43%5*(23*3%2))); and "45+43%5*(23*3%3)=" is in double quote and System.out.println print as it is which is inside in double quotes and after + sign it will perform arithmatic operation and print result like here it is 48.

Answer 2: Output of question 2 will be FALSE and its output will be like:

!(x<=y-2)&&(y>=z)||(z-2!=20)=false

Reason: Because both condition is wrong. In first Condition "" !(x<=y-2)&&(y>=z) "" y>=z is false and In second condition (z-2!=20) Is false so output will be false.

I hope this solves your problem

Comment if you have any problem in above answer

And please give it a thumbs up if it solved your problem :)