Question: ( 1 0 pts ) Suppose we have declared and initialized the following variables: int x = 2 3 ; int y = 5 ;

(10 pts) Suppose we have declared and initialized the following
variables:
int x=23;
int y=5;
double val =9.72;
Show what is printed in each of the following code fragments
(assume they are executed in order). Please show your work.
a) int result =x%y**xy-(int) val;
System.out.println(result);
b) result = result %3+17-4-y;
System.out.println(result);c)
boolean test (val==9)==0j=1j+=3=(y && (val==9);
test =! test;
System.out.println(test);
d) int count =0;
int j=1;
while (count10){
switch (j){
case 1:
System.out.println("top");
case 2:
System. out . println("middle");
case 3 :
System.out .println("bot tom");
}
break;
System. out.println (count);
j++;
count +=3;
}
 (10 pts) Suppose we have declared and initialized the following variables:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!