Question: please use regular java, along with the use of arrays. Nothing too complicated, still on beginner mode. Thanks! 1) Today you are to write a
1) Today you are to write a Java program that will accept 2 integer values; the first is the size of the one-dimensional array (which you can assume is odd and at least 5) and the second is the starting value to fill the array with After creating the array of the specified size, fill the array starting with the 2nd integer entered in the last position and incremented by 3 for each previous position. Display the resulting array. Once this is done rotate all the entries with even indexes 2 positions to the left (if the size is 5, whatever is in index location 4 is stored in index position 2, whatever is in 2, is stored in index position 0, and so on). The first entry is to be stored in the last location (size -1) of the array. Display the resulting array. All output must be formatted exactly as displayed in the two samples below. The box below illustrates how your program should behave and appear: Whatsize do you want your array-to-be (minimumsize5and-an odd number)?.11.1 Starting integer value: Original array: 30 27 24 21 15 129 6 18 3 Array after rotation: 24 27 18 21 12 15 6 9 30 What size do you want your array to be (minimum size 5. and an odd number)? 5. Starting integer value: 1.1 Blue arrows show which Original and numbers are to be 13+ 10 7 4 17 rotated and to where Array after rotation: 7 10+ 1+ 4+ 13 Note 1: You are to expect a perfect user who will always enter an odd array size; that is, do not verify the validity of user input Note 2: The use of libraries other than java.util.Scanner is prohibited. Your program must work for any odd array size and starting value, not just the ones in the samples above. Note 3: You are free to use whichever type of loop you want
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
