What is the output of the following program and explanation of how to figure it
ID: 3642255 • Letter: W
Question
What is the output of the following program and explanation of how to figure it out???public class Solve
{
public static void main (String[] args)
{
int j;
int [] int [5];
int [] two = new int [10];
for (j = 0; j<5; j++)
{
one[j] = 5*j+3;
}
System.out.print ("One contains: ");
for (j=0; j<5; j++)
{
System.out.print (one[j] + " ");
}
System.out.println();
for (j=0; j<5; j++)
{
two[j] = 2*one[j] - 1;
two[j+5] = one[4-j] + two[j];
}
System.out.print ("Two contains: ");
for (j=0; j<10; j++)
{
System.out.print (two[j] + " ");
}
System.out.println();
}
}
Explanation / Answer
one[j] = 5*j+3;One contains: 3 8 13 18 23two[j] = 2*one[j] - 1; two[j+5] = one[4-j] + two[j]; Two contains: 5 15 25 35 45 28 33 38 43 48
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.