Aggiunta soluzione prof a ExpGenerator
Soluzione sbagliata o trascrizione sbagliata? Ultimo numero stampato è sempre 1.0
This commit is contained in:
23
6.x/p6.12/Sol Prof/ExpTester.java
Normal file
23
6.x/p6.12/Sol Prof/ExpTester.java
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user