<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package integral;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class Client {

	public static void main(String[] args) {
        try {
            Registry registry = LocateRegistry.getRegistry(args[0]);
            IntegralService trapIntegral = (IntegralService) registry.lookup("Trapezoidal");
            IntegralService simpIntegral = (IntegralService) registry.lookup("Simpson");
            Function&lt;Double, Double&gt; sin = new Sin(new Range&lt;Double&gt;(Double.MIN_VALUE, Double.MAX_VALUE));
            System.out.println(trapIntegral.compute(sin, new Range&lt;Double&gt;(0.0, 2*Math.PI)));
            System.out.println(simpIntegral.compute(sin, new Range&lt;Double&gt;(0.0, 2*Math.PI)));
            
        } catch (Exception e) {
            System.err.println("Client exception:");
            e.printStackTrace();
        }
    }    

}
</pre></body></html>