Intro to Java Day 17 Homework
Remember that arrays have zero-based indexing!
Email *
What is printed out by this code segment? *
1 point
Captionless Image
What are the contents of the array arr after this code is run? *
1 point
Captionless Image
What is printed out by this code segment? *
1 point
Captionless Image
What does the following code snippet do? Assume that arr is a properly declared and initialized int array.
*
1 point
Captionless Image
Is this a proper way to find the sum of all odd numbers in arr? *
1 point
Captionless Image
What does the following code snippet do? Assume that arr is a properly declared and initialized int array.
*
1 point
Captionless Image
How would we change the following code snippet so that it switches the first and second values of the array instead?
*
1 point
Captionless Image
Programming Question

Write a program that inverts a 2D array. Inverting a 2D array means that each row of the 2D array is now a column, and each column is now a row.

Sample input

  1 1 1 
  2 2 2 
  3 3 3  

Sample output

  1 2 3 
  1 2 3 
  1 2 3  

*
1 point
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy