Replace (????) with relevant code for the program to function. Details of the code have been given below. (Java has been used) a) This program should display: 16 5 2 6 5 8 */ package finalexamtakehome4; /** * * @author sweetkim */ public class Finalexamtakehome4 { // public static void show(int x, int y) { if (x = y) { x = x + 11; } else if (x > 2 * y) { x = 0; } if (x == 0 y > x) { x = x + 2; y = y + 2; } System.out.println(x + " " + y); } // public static void main(String[] args) { showYval(????); showYval(????); showYval(????); } }
3) Replace (????) with relevant code for the program to function. Details of the code have been given below. (Java has been used)
a) This program should display:
16 5
2 6
5 8
*/
package finalexamtakehome4;
/**
*
* @author sweetkim
*/
public class Finalexamtakehome4 {
//
public static void show(int x, int y) {
if (x = y) {
x = x + 11;
} else if (x > 2 * y) {
x = 0;
}
if (x == 0 y > x) {
x = x + 2;
y = y + 2;
}
System.out.println(x + " " + y);
}
//
public static void main(String[] args) {
showYval(????);
showYval(????);
showYval(????);
}
}
/*
b) This program should display:
2 -2 3
16 13 11 10 0
-10
*/
package finalexamtakehome5;
public class Finalexamtakehome5 {
//
public static void the(int x, int y) {
while (x > 0 | y > 0) {
x = x - y;
y--;
System.out.print(x + " ");
}
System.out.println(y);
}
//
public static void main(String[] args) {
theWhile(????);
theWhile(20, 4);
theWhile(40, -10, 7, 9);
}
}
Step by step
Solved in 4 steps with 2 images