Java List Sum sum(List scores)

Here you can find the source of sum(List scores)

Description

sum

License

LGPL

Parameter

Parameter Description
scores a parameter

Declaration

public static double sum(List<Double> scores) 

Method Source Code

//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;
    }
}

Related

  1. sum(final List list)
  2. sum(int[] list)
  3. sum(List list)
  4. sum(List a)
  5. sum(List data)
  6. sum(List vals)
  7. sum(List l)
  8. sum(List list)
  9. sum(List lst)