Question: 7. Without using your computer, what is the output of the following code int[] a = { 1, -2, 4, 7, 23 }; for (int
7. Without using your computer, what is the output of the following code
int[] a = { 1, -2, 4, 7, 23 };
for (int k=1; k a[k]=a[k-1]; for (int x: a) System.out.println(x); 8. Write code that will sort an array of Rational objects from Lab xx. Test your code with the values Rational[ ] fracs = new Rational[5]; fracs[0] = new Rational(1, 2); fracs[1] = new Rational(1,3); fracs[2] = new Rational(7,8); fracs[3] = new Rational(1, 100); fracs[4] = new Rational(5, 16);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
