Write a program that implements the example described at the beginning of Section 10.6. Your program should shift the array’s elements from position x to position x −1 as described in that section. (Move the value at position 1 to position 0; move the value at position 2 to position 1, and so on).
Start by creating two arrays, double[] initialHours and double[] hours. In its declaration initialize initialHours with the values {8, 8, 6, 4, 7, 0, 0, 5}, but don’t initialize hours when you declare and instantiate it with its 31 elements. Instead, initialize hours after its creation by using System.arraycopy to copy all the values in initialHours into the first elements in hours. Then perform one down-shift operation, and load zero into the (new) highest element.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.