Question
Write a program called 'Lab8.java' which does the following: 1) Creates an int array containing the digits of today's date: 0 2 2 5 2
Write a program called 'Lab8.java' which does the following:
1) Creates an int array containing the digits of today's date: 0 2 2 5 2 0 2 1
2) Make a copy of the array
3) Print both arrays with labels. For example:
arrayA = [0, 2, 2, 5, 2, 0, 2, 1]
copyOfA = [0, 2, 2, 5, 2, 0, 2, 1]
4) sort the copy (The original should be unchanged.)
5) print both arrays again to show that only the copy was sorted. Example:
After sorting:
arrayA = [0, 2, 2, 5, 2, 0, 2, 1]
copyOfA = [0, 0, 1, 2, 2, 2, 2, 5]
6) Reverse the copy and print both arrays again. (The original should be unchanged.)
7) print the following statistics about the original array:
The size:
The minimum element:
The maximum element:
The sum of the elements:
The average of the elements: (show exactly 2 decimal places)
8) Create the 2D array shown below (which represents a Sudoku puzzle):
9) Print the 2D array from question 8 shown above.
9 1 16 2 4 39 6 4 2 739 5 8 1 3 94 3 7 82 9 4 3 2 6 8 9 6 1 3 4 1. 8 9 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started