Advertisement
advictoriam

Untitled

Jan 16th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Prices
  3. {
  4.    /**
  5.       A method to determine and return the average price
  6.    */
  7.    public static double averagePrice(double[] priceData)
  8.    {
  9.       double sum = 0;
  10.       for (double a : priceData)
  11.       {
  12.          sum += a;
  13.       }
  14.       return sum / priceData.length;
  15.    }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement