Instructions CPS 150 Lab Project 25: Rotating Java Arrays (Java Arrays With Methods) This lab project is due on Monday, April 11, 2022 at 12:30 pm. Write a method that is passed an array, x, of...


Instructions<br>CPS 150 Lab Project 25: Rotating<br>Java Arrays (Java Arrays With<br>Methods)<br>This lab project is due on Monday, April<br>11, 2022 at 12:30 pm.<br>Write a method that is passed an array, x, of<br>doubles and an integer rotation amount, n.<br>The method creates a new array with the<br>items of x moved forward by n positions.<br>1. Create a new Eclipse project named<br>Lab_Project_25<br>2. Download the source code file<br>Array_Spinner.java and import it into<br>your Eclipse project.<br>3. Open the source code in Eclipse.<br>4. Add your name to the comment block at<br>the top of the file<br>5. Complete the rotate method as described<br>in the source code<br>Notes<br>Elements that are rotated off the array will<br>appear at the end. For example, suppose x<br>contains the following items in sequence:<br>1234567<br>After rotating by 3, the elements in y will<br>appear in this sequence:<br>4567123<br>Array x should be left unchanged by your<br>program. Be sure to test your program with<br>different array sizes and rotation amounts<br>(see Sample Run, below).<br>Sample Run (user input in color):<br>Before rotation:<br>x[0]:<br>8.0<br>x[1]:<br>4.0<br>x[2]:<br>5.0<br>x[3]:<br>21.0<br>x[4]: 7.0<br>x[5]:<br>9.0<br>x[6]:<br>18.0<br>x[7]:<br>2.0<br>x[8]:<br>100.0<br>After rotation:<br>y[0]: 21.0<br>y[1]:<br>y[2]:<br>y[3]:<br>y[4]:<br>У [5]:<br>y[6]:<br>y[7]:<br>y[8]:<br>7.0<br>9.0<br>18.0<br>2.0<br>100.0<br>8.0<br>4.0<br>5.0<br>What Do I Hand In?<br>• Attach your completed source code<br>(Array_Spinner.java) file below.<br>Then click Submit.<br>

Extracted text: Instructions CPS 150 Lab Project 25: Rotating Java Arrays (Java Arrays With Methods) This lab project is due on Monday, April 11, 2022 at 12:30 pm. Write a method that is passed an array, x, of doubles and an integer rotation amount, n. The method creates a new array with the items of x moved forward by n positions. 1. Create a new Eclipse project named Lab_Project_25 2. Download the source code file Array_Spinner.java and import it into your Eclipse project. 3. Open the source code in Eclipse. 4. Add your name to the comment block at the top of the file 5. Complete the rotate method as described in the source code Notes Elements that are rotated off the array will appear at the end. For example, suppose x contains the following items in sequence: 1234567 After rotating by 3, the elements in y will appear in this sequence: 4567123 Array x should be left unchanged by your program. Be sure to test your program with different array sizes and rotation amounts (see Sample Run, below). Sample Run (user input in color): Before rotation: x[0]: 8.0 x[1]: 4.0 x[2]: 5.0 x[3]: 21.0 x[4]: 7.0 x[5]: 9.0 x[6]: 18.0 x[7]: 2.0 x[8]: 100.0 After rotation: y[0]: 21.0 y[1]: y[2]: y[3]: y[4]: У [5]: y[6]: y[7]: y[8]: 7.0 9.0 18.0 2.0 100.0 8.0 4.0 5.0 What Do I Hand In? • Attach your completed source code (Array_Spinner.java) file below. Then click Submit.

Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here