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

Public class Finalql {public static void main(String [] args) {double x=4, y=3,

ID: 3581089 • Letter: P

Question

Public class Finalql {public static void main(String [] args) {double x=4, y=3, z=5, t=4; x = mystery(y.z); System.out.println(" 1: x = "+x); x = mystery(y, mystery(z, t)); System.out.println("2: x = "+x); x = Matb.pow(mystery(2, 2), 2); System.out.println("3: x = "+x); x - Math. squareroot (mystery(y-l, z+t-l)); System.out.println("4: x = "+x); x = mystery(l+2, 2+3); System.out.println(''5: x = "+x); x = mystery(2, 3)+mystery(4, 2); System.out.println("6: x = "+x); x = mystery(4, mystery(3, 2)); System.out.println("7: x = "+x); x = mystery(mystery(2, 3).mystery(3, 4)); System.out.println("8: x = "+x);} public Static double mystery(double x, double y) {return(x*y);}}

Explanation / Answer

import java.util.*;
public class finalq1
{
public static void main(String[] args)
{
double x=4,y=3,z=5,t=4;

x=mystery(y,z);
System.out.println("1: x="+x);

x=mystery(3,mystery(5,t));
System.out.println("2: x="+x);

x=Math.pow(mystery(2,2),2);
System.out.println("3: x="+x);

x=Math.sqrt(mystery(y-1,z+t-1));
System.out.println("4: x="+x);

x=mystery(1+2,2+3);
System.out.println("5: x="+x);

x=mystery(2,3)+mystery(4,2);
System.out.println("6: x="+x);

x=mystery(4,mystery(3,2));
System.out.println("7: x="+x);

x=mystery(mystery(2,3),mystery(3,4));
System.out.println("8: x="+x);

}

public static double mystery(double x,double y)
{
return(x*y);
}

}

output

1. x=15.0
2. x=60.0
3. x=16.0
4. x=4.0
5. x=15.0
6. x=14.0
7. x=24.0
8. x=72.0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote