IN JAVA CODE PLEASE!! take problem 1.o and make it work for negative numbers . W
ID: 3760340 • Letter: I
Question
IN JAVA CODE PLEASE!!
take problem 1.o and make it work for negative numbers.
Write a program to accomplish the following tasks:
1) make a random number between 10 and 100;
2) make an array of the size of the random number;
3) fill the array with random integers from 0 to 999;
4) print lines of output for each of these:
a) the original members of the array
b) every element at an even index based on the original displayed array
c) every even element based on the original displayed array
d) the reverse of the original array
e) the first and last element based on the original displayed array, use the length not a literal number
f) swap the first and last element based on the original displayed array
g) shift all elements to the right once, move the last element to the first based on the original displayed array
h) replace all even elements with the number zero based on the original displayed array
i) replace each element except the first and last with the larger of its two neighbors based on the original displayed array
j) remove the two middle elements based on the original displayed array
k) move all odd elements to the front otherwise preserving the order of the array based on the original displayed array
l) display true if the original array is stored in increasing order
m) display true if the array contains two adjacent elements that are equal
n) compute the alternating sum of all elements in the array, for example: 1 2 3 4 5 would be computed as 1 - 2 + 3 - 4 + 5 ...
o) display a bar chart equal to the value of the number in each element, for example: 1 2 3 4 5 would display as:
*
**
***
****
*****