Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Prices
- {
- /**
- A method to determine and return the average price
- */
- public static double averagePrice(double[] priceData)
- {
- double sum = 0;
- for (double a : priceData)
- {
- sum += a;
- }
- return sum / priceData.length;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement