Ilame 7 10 Pts Show Printed Following Program Problem 7 Public Class Problem7 Public Stati Q43843815
Ilame. 7.(10 pts) Show what is printed by the following program: /* problem 7*/ public class problem7 { public static void main(String[] args) { int x, y, r= 30; String str; str = “Mark Twain”; x=-10; y=-5; System.out.println (str + ” ” + x +””+y+””+r); y = mymethod(str, x,y); System.out.println (str + ” “+x+””+y+””+r); str = “Tom Sawyer”; x= 5, y = 10; System.out.println (str +””+x+””+y+” ” + r); y = mymethod(str, x,y); System.out.println (str + ” “+x+””+y+””+r); public static int mymethod(String mystr, int p, int q) the third time soon int r; alue RCA mystr = “Tom Sawyer”;bebes the corrected q=Math.abs(9) + 5; p= 10 – p; r=q-p; System.out.println (mystr + ” “+p+””+q+””+r); return r; Show transcribed image text Ilame. 7.(10 pts) Show what is printed by the following program: /* problem 7*/ public class problem7 { public static void main(String[] args) { int x, y, r= 30; String str; str = “Mark Twain”; x=-10; y=-5; System.out.println (str + ” ” + x +””+y+””+r); y = mymethod(str, x,y); System.out.println (str + ” “+x+””+y+””+r); str = “Tom Sawyer”; x= 5, y = 10; System.out.println (str +””+x+””+y+” ” + r); y = mymethod(str, x,y); System.out.println (str + ” “+x+””+y+””+r); public static int mymethod(String mystr, int p, int q) the third time soon int r; alue RCA mystr = “Tom Sawyer”;bebes the corrected q=Math.abs(9) + 5; p= 10 – p; r=q-p; System.out.println (mystr + ” “+p+””+q+””+r); return r;
Expert Answer
Answer to Ilame. 7.(10 pts) Show what is printed by the following program: /* problem 7*/ public class problem7 { public static vo…
OR