Completato esercizio p6.12 con Sequence

This commit is contained in:
2023-01-08 16:57:54 +01:00
parent 488aa8d04d
commit dc16cd2e7a
3 changed files with 64 additions and 0 deletions

23
6.x/p6.12/ExpTester.java Normal file
View File

@@ -0,0 +1,23 @@
import java.util.Scanner;
/**
Classe che esegue il test dell'uso della funzione ExpApprossimator
@author radaelli11353
*/
public class ExpTester {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Inserisci il valore di x");
double x = in.nextDouble();
ExpApprossimator gen = new ExpApprossimator(x);
double sum = 1;
while(gen.hasNext()) {
sum += gen.next();
}
System.out.println(sum);
}
}