logo Practice-It logo

BJP4 Self-Check 7.14: arrayCodeTracing2

Language/Type: Java arrays array mystery
Author: Marty Stepp (on 2016/09/08)

Fill in the array with the values that would be stored after the code executes:

int[] list = {2, 18, 6, -4, 5, 1};
for (int i = 0; i < list.length; i++) {
    list[i] = list[i] + (list[i] / list[0]);
}
list[0]
list[1]
list[2]
list[3]
list[4]
list[5]

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.