import java.io.*;
import javax.swing.*;
import jxl.*; 
import jxl.write.*;
import jxl.format.*;
 
//import java.util.Locale;

public class FINAL2010_4
{ 
	 	
public static void main(String args[]) throws IOException
{
	
try
{
WritableWorkbook workbook = Workbook.createWorkbook(new File("DATA4.xls")); 
WritableSheet sheet = workbook.createSheet("First Sheet", 0); 
NumberFormat fivedps = new NumberFormat("#.#####"); 
WritableCellFormat fivedpsFormat = new WritableCellFormat(fivedps); 
for(int i=0;i<21;i++)
{ double x=i;
  double y=i*i;
jxl.write.Number nx = new jxl.write.Number(1, i+1, x, fivedpsFormat); 
sheet.addCell(nx); 
jxl.write.Number ny = new jxl.write.Number(2, i+1, y, fivedpsFormat); 
sheet.addCell(ny); 
}
workbook.write();
workbook.close();  
}catch(jxl.write.WriteException we) {System.out.println("write exception");}
}

}
