import javax.swing.*;
import java.awt.*;

public class numeric1
{
    public static void main(String[] args)
    {
    Object[] o={"Bisection root finding",	
                "False position root finding",
                "Stephensen root finding",
                "Brent root finding",
                "Ridder root finding",	
                "Newton root finding",
                "Secant root finding",
                "Inverse interpolation root finding",
                "Muller root finding",	
                "Newton-bisection root finding",
                "Golden search optimisation",		
                "Quadratic polynomial optimisation",
                "Cubic polynomial optimisation",	
                "Newton optimisation",
                "Brent optimisation",
                "plot the function"};
    ImageIcon picture=new ImageIcon("fall.jpg");              
    String name=(String)JOptionPane.showInputDialog(null,"Please select a name : ",
    "JOptionPane example",JOptionPane.QUESTION_MESSAGE,picture,o,"Bisection root finding");
    if(name=="Bisection root finding")
    {
	double a[]=Text.readDoubleV("x_low,x_high = ");
	double x=ez.bisection(a[0],a[1]);
	print(name+" root x="+x+name+"method");
	}
	else if(name=="False position root finding")
    {
	double a[]=Text.readDoubleV("x_low,x_high = ");
	double x=ez.false_position(a[0],a[1]);
	print(name+" root x="+x+name+"method");
	}
    else if(name=="Stephensen root finding")
    {
	double a[]=Text.readDoubleV("x   = ");
	double x=ez.stefensen(a[0]);
	print(name+" root x="+x+name+"method");
	}
	else if(name=="Brent root finding")
    {
	double a[]=Text.readDoubleV("x_low,x_high = ");
	double x=ez.brent(a[0],a[1]);
	print(name+" root x="+x+name+"method");
	}
	else if(name=="Ridder root finding")
    {
	double a[]=Text.readDoubleV("x_low,x_high = ");
	double x=ez.ridder(a[0],a[1]);
	print(name+" root x="+x+name+"method");
	}
	
    }
}