Replace (????) with relevant code for the program to function. Details about the programs are provided below. (Jav has been used). Show the output. a)This program prints four lines: kimarr() 4 [9, 0, 0, 14] 2 [9, 0, 0, 14] kimarr() 8 [9, 9, 14, 14] 4 [9, 9, 14, 14] */
Replace (????) with relevant code for the program to function. Details about the programs are provided below. (Jav has been used). Show the output.
a)This program prints four lines:
kimarr() 4 [9, 0, 0, 14]
2 [9, 0, 0, 14]
kimarr() 8 [9, 9, 14, 14]
4 [9, 9, 14, 14]
*/
package finalexamtakehome2;
import java.util.*; // for Arrays class
/**
*
* @author sweetkim
*/
public class Finalexamtakehome2 {
//
public static void kimarr(int x, int[] a) {
x = x * 2;
if (x > 6) {
a[2] = 4;
a[1] = 9;
} else {
a[0] = 9;
a[3] = 1;
}
System.out.println("kimarr() " + x + " " + Arrays.toString(????));
}
//
public static void main(String[] args) {
int x = 1;
int[] a = new int[4];
x = x * ????;
kimarr(x, a);
System.out.println(x + " " + Arrays.toString(????));
x = x * 2;
kimarr(x, a);
System.out.println(x + " " + Arrays.toString(????));
}
}
/*
Step by step
Solved in 4 steps with 3 images