SHARE
TWEET

Untitled

advictoriam Jan 16th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top