For each call to the following method indicate what console

For each call to the following method, indicate what console output is produced: public void mysteryXY(int x, int y) {if (y == 1) {System.out.print(x);} else {System.out.print(x * y + \", \"); mysteryXY(x, y - 1); System.out.print(\", \" + x * y);}} mysteryXY(4, 1); mysteryXY(4, 2); mysteryXY(8, 2); mysteryXY(4, 3); mysteryXY(3, 4);

Solution

Answer:

mystertXY(4,1) will print 4

mystertXY(4,2) will print 8, 4, 8

mystertXY(8,2) will print 16, 8, 16

mystertXY(4,3) will print 12, 8, 4, 8, 12

mystertXY(3,4) will print 12, 9, 6, 3, 6, 9, 12

 For each call to the following method, indicate what console output is produced: public void mysteryXY(int x, int y) {if (y == 1) {System.out.print(x);} else {

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site