Question: Complete the partial declaration of class Calculate as stated in the comment below. // (i) to receive input x and y values from user. (3

Complete the partial declaration of class Calculate as stated in the comment below. // (i) to receive input x and y values from user. (3 pt) // (iii) Call methods to assign the values received from the user. (1 pt) Il (iv) display outputs on the screen as the sample. (1 pt) // update code public class Calculate { public int doMath(int x, int y) { return (x-y); } } public class CalculateApp { public static void main() { 1/ update cose Calculate cal = new Calculate(): Il update code For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac). B IVS Paragraph Arial > 14px What is the output of this program? public class Calculate { public int doMath(int x, int y) { return (x-y); } } public class CalculateApp { public static void mainot int x = 5; int y = 20; Calculate cal = new Calculate(); x = cal.do Math(y,x); System.out.print("x=" + x + ", y=" + y); y = cal.doMath(x,x); System.out.print("x=" + x +", y="+y); } } x=15, y=20 x=15, y=0 x=15, y=20 x=0, y= 15 x=15, y=20 x=15, y=20 x=0, y=15 x=15, y= 20
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
