Advertisement
Guest User

Untitled

a guest
Jan 29th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.81 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.File;
  3. import java.io.FileNotFoundException;
  4. import java.io.FileReader;
  5. import java.io.IOException;
  6. import java.util.ArrayList;
  7. import java.util.List;
  8.  
  9. public class SimpleClass {
  10.  
  11.    
  12.     public static void main(String[] args) {
  13.          File file = new File(args[0]);
  14.          List<Double> lista = new ArrayList<Double>();
  15.          try {
  16.             BufferedReader br = new BufferedReader(new FileReader(file));
  17.               String st;
  18.               while ((st = br.readLine()) != null)
  19.                 lista.add(Double.parseDouble(st));
  20.              
  21.         } catch (Exception e) {
  22.             e.printStackTrace();
  23.         }
  24.          
  25.  
  26.     }
  27.    
  28.     public Double sinus(List<Double> lista) {
  29.         Double suma = 0.0;
  30.         for(int i = 0; i < lista.size(); i++) {
  31.             suma = suma * Math.pow(-1, i) * (Math.pow(lista.get(0), b))
  32.         }
  33.         return suma;
  34.     }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement