compute: val = (√i)√j\nex: if the input is 4.0 9.0, then the output is:\nval = 8.0\n1 import…

compute: val = (√i)√j\nex: if the input is 4.0 9.0, then the output is:\nval = 8.0\n1 import java.util.scanner;\n2\n3 public class mathmethods {\n4 public static void main(string args) {\n5 scanner scnr = new scanner(system.in);\n6 double i;\n7 double j;\n8 double val;\n9\n10 i = scnr.nextdouble();\n11 j = scnr.nextdouble();\n12\n13 /* your code goes here */\n14\n15 system.out.printf(\val = %.1f\\n\, val); // outputs val with 1 decimal place\n16 }\n}

compute: val = (√i)√j\nex: if the input is 4.0 9.0, then the output is:\nval = 8.0\n1 import java.util.scanner;\n2\n3 public class mathmethods {\n4 public static void main(string args) {\n5 scanner scnr = new scanner(system.in);\n6 double i;\n7 double j;\n8 double val;\n9\n10 i = scnr.nextdouble();\n11 j = scnr.nextdouble();\n12\n13 /* your code goes here */\n14\n15 system.out.printf(\val = %.1f\\n\, val); // outputs val with 1 decimal place\n16 }\n}

Answer

Explanation:

Step1: Take square - root of i

Let the input values for (i) and (j) be read from the user. First, calculate (\sqrt{i}), which in Java can be done using Math.sqrt(i).

Step2: Raise to the power of square - root of j

Then raise the result of (\sqrt{i}) to the power of (\sqrt{j}). In Java, this can be done using Math.pow(Math.sqrt(i), Math.sqrt(j)).

Here is the completed Java code:

import java.util.Scanner;

public class MathMethods {
    public static void main(String[] args) {
        Scanner scnr = new Scanner(System.in);
        double i;
        double j;
        double val;

        i = scnr.nextDouble();
        j = scnr.nextDouble();

        val = Math.pow(Math.sqrt(i), Math.sqrt(j));

        System.out.printf("val = %.1f\n", val);
    }
}

If you just want the mathematical calculation part without the code: Let (i) and (j) be the input values. First, calculate (a=\sqrt{i}) and (b = \sqrt{j}), then (val=a^{b}).

Answer:

The code to complete the calculation in the given Java program is val = Math.pow(Math.sqrt(i), Math.sqrt(j)); and the mathematical operation is to first find the square - root of (i), then raise that result to the power of the square - root of (j).