How Would I finish this code for an Intro To Java Class In t
How Would I finish this code for an Intro To Java Class?
In the following program, print the sum of the first and last element in the partially filled array prices with companion variable numberOf Prices. Complete the following file: FirstAndLast.java import java.util.Scanner; public class FirstAndLast {public static void main(String[] args) {final int LENGTH = 100; double[] prices = new doublet [LENGTH]; int numberOfPrices = theta; Scanner in = new Scanner(System.in); while (in.hasNextDouble()) {if (numberOfPricesSolution
Answer: double sum = prices[0] + prices[numberOfPricecs-1];
This stateent will give you the sum of first and last values of double array.

