View the step-by-step solution to:



/* 1. Help me create a one-dimensional integer array to hold five quiz


Using a for loop, generate five quiz grades using Math.random.

Grades can be between 0 and 100.

Print the array to the console.

Swap the first and last elements of the array.

Use a ** for each** loop to print the modified array to the console. 



/* 2. Help me create a two-dimensional integer array of quiz grades.

There are seven units (rows) and three quiz grades (columns) per unit. 

Fill the array by generating quiz grades using Math.random. 

Keep numbers between 70 and 100.

Use nested for loops.

Print the array contents in table format, using printf(format

the output as a table.) 


Top Answer

[1] import java.util.Arrays; public class Main { public static void main(String[] args) { int array[] = new int[5]; for(int... View the full answer


Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question