Aggiunta soluzione prof a ExpGenerator

Soluzione sbagliata o trascrizione sbagliata? Ultimo numero stampato è
sempre 1.0
This commit is contained in:
2023-01-11 17:27:33 +01:00
parent ed085aaf36
commit f3380f8888
3 changed files with 56 additions and 0 deletions

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();
ExpGenerator gen = new ExpGenerator(x);
double sum = 1;
while(gen.hasNext()) {
System.out.println(gen.next());
}
System.out.println(sum);
}
}