import java.awt.*;
import java.applet.Applet;

public class Infinite extends Applet
{
    public void paint(Graphics g)
    {
       int odd = 3;
       int plus = 3;
       float total = 1.0f;
       int x = 10;
       int y = 20;

       g.drawString("4 - ",x,y);
       while (total>0.001)
       {
         g.drawString("-1/"+odd,x+10,y+10);
         odd = odd+2;
         x = x+35;
         total = total-(1.0f/odd);
         g.drawString("+1/"+plus,x+10,y+10);
         plus = plus+2;
         x = x+35;
         total = total+(1.0f/plus);
         if (x>3.14)
         {
           y = y+30;
           x = 20;
         }
        showStatus("Total :  " +total);
       } 
    }
}
