Here you can find the source of sum(List
Parameter | Description |
---|---|
scores | a parameter |
public static double sum(List<Double> scores)
//package com.java2s; /**/*from w w w. j av a2s. c om*/ * Computes the intersection between two lines. The calculated point is approximate, * since integers are used. If you need a more precise result, use doubles * everywhere. * (c) 2007 Alexander Hristov. Use Freely (LGPL license). http://www.ahristov.com * * @param x1 Point 1 of Line 1 * @param y1 Point 1 of Line 1 * @param x2 Point 2 of Line 1 * @param y2 Point 2 of Line 1 * @param x3 Point 1 of Line 2 * @param y3 Point 1 of Line 2 * @param x4 Point 2 of Line 2 * @param y4 Point 2 of Line 2 * @return Point where the segments intersect, or null if they don't */ import java.util.List; public class Main { /** * * @param scores * @return */ public static double sum(List<Double> scores) { double f = 0.0; for (Double score : scores) { f += score; } return f; } }