Main.java ArrayReversal.java ! 1 2 import java.util.Scanner; 3. 4- public class ArrayReversal { /* Reverse values in the array */ public void reverseValues(int[] arrayVals) { int i; int tempStore; //...


How do I fix it in GDB?




Main.java<br>ArrayReversal.java !<br>1<br>2 import java.util.Scanner;<br>3.<br>4- public class ArrayReversal {<br>/* Reverse values in the array */<br>public void reverseValues(int[] arrayVals) {<br>int i;<br>int tempStore; // Temp variable for swapping<br>6.<br>7<br>8<br>9.<br>10<br>for (i = 0; i < (arrayVals.length / 2); ++i) {<br>// Swap two values<br>tempStore<br>arrayVals[i] = arrayVals[arrayVals.length - 1 - i];<br>arrayVals[arrayVals.length - 1 - i]<br>}<br>11<br>12<br>13<br>arrayVals[i];<br>14<br>15<br>tempStore;<br>16<br>17<br>}<br>18<br>/* Prompt user to enter values * /<br>public void fillValues(int[] arrayVals) {<br>Scanner scnr = new Scanner (System.in);<br>int i;<br>19<br>20<br>21<br>22<br>23<br>System.out.println(

Extracted text: Main.java ArrayReversal.java ! 1 2 import java.util.Scanner; 3. 4- public class ArrayReversal { /* Reverse values in the array */ public void reverseValues(int[] arrayVals) { int i; int tempStore; // Temp variable for swapping 6. 7 8 9. 10 for (i = 0; i < (arrayvals.length="" 2);="" ++i)="" {="" swap="" two="" values="" tempstore="" arrayvals[i]="arrayVals[arrayVals.length" -="" 1="" -="" i];="" arrayvals[arrayvals.length="" -="" 1="" -="" i]="" }="" 11="" 12="" 13="" arrayvals[i];="" 14="" 15="" tempstore;="" 16="" 17="" }="" 18="" *="" prompt="" user="" to="" enter="" values="" *="" public="" void="" fillvalues(int[]="" arrayvals)="" {="" scanner="" scnr="new" scanner="" (system.in);="" int="" i;="" 19="" 20="" 21="" 22="" 23="" system.out.println("enter="" for="" (i="0;" i="">< arrayvals.length;="" ++i)="" {="" system.out.print("value:="" ");="" +="" arrayvals.length="" +="" values...");="" %3d="" %3d="" 24="" 25="" -="" 26="" input="" stderr="" compilation="" failed="" due="" to="" following="" error(s).="" main.java:4:="" error:="" class="" arrayreversal="" is="" public,="" should="" be="" declared="" in="" a="" file="" named="" arrayreversal.java="" public="" class="" arrayreversal="" {="" arrayreversal.java:4:="" error:="" duplicate="" class:="" arrayreversal="" public="" class="" arrayreversal="" {="" 2="">

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here