Please help i need a sourcecode i think it�s easy

Please help
i need the source code
for a programm
which should ask me for a number
for instance: "7"
and then should the programm write "seven"
please help

I wrote it as a test some time ago:
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class N2t extends Frame 
     Panel pr = new Panel();
     TextField fin = new TextField(20);
     Label     fot = new Label();
     Button    but = new Button(" Go ");
     Vector    vy  = new Vector();
     Vector    va  = new Vector();
     Vector    vh  = new Vector();
public N2t()
     super();
     setBounds(10,10,550,200);     
     addWindowListener(new WindowAdapter()
    {     public void windowClosing(WindowEvent ev)
               dispose();     
               System.exit(0);
     pr.setBackground(Color.pink);
     add(pr);
     pr.setLayout(null);
     fin.setBounds(10,20,100,20);
     fot.setBounds(10,50,500,20);
     fot.setBackground(Color.white);
     but.setBounds(10,90,100,20);
     pr.add(fin);
     pr.add(fot);
     pr.add(but);
       setVisible(true);
     vy.add("");
     vy.add("one");
     vy.add("two");
     vy.add("three");
     vy.add("four");
     vy.add("five");
     vy.add("six");
     vy.add("seven");
     vy.add("eight");
     vy.add("nine");
     vy.add("ten");
     vy.add("eleven");
     vy.add("twelve");
     vy.add("threaten");
     vy.add("fourteen ");
     vy.add("fifteen");
     vy.add("sixteen");
     vy.add("seventeen");
     vy.add("eighteen");
     vy.add("nineteen");     
     va.add("twenty");     
     va.add("threaty");
     va.add("fourty ");
     va.add("fifty");
     va.add("sixty");
     va.add("seventy");
     va.add("eighty");
     va.add("ninety");     
     vh.add("");
     vh.add("Tousend");
     vh.add("Milion");
     but.addActionListener(new ActionListener()
     {     public void actionPerformed(ActionEvent be) 
               calc();
private void calc()
     int i=0, m=0, y;
     try
           i = Integer.parseInt(fin.getText());
     catch(NumberFormatException e) {return;}
     String txt = "";
     while (i > 0)
          y = i%1000;
          i = i/1000;
          if (y > 0) txt = calcI(y)+" "+(String)vh.get(m)+" "+txt;
          m++;
     fot.setText(txt);     
private String calcI(int i)
     String txt = "";
     if (i > 99)
          txt = (String)vy.get(i/100)+" Hundred ";
          i = i%100;
     if (i > 19)
          i = i - 20;
          int a = i / 10;
          i = i - (a * 10);
          txt = txt+(String)va.get(a)+" ";
     return(txt+(String)vy.get(i));     
public static void main (String[] args)
     new N2t();  
Noah

Similar Messages

Maybe you are looking for

  • Adobe Photoshop CS5 Lag

    Hi, Every time I open Adobe Photoshop CS5, the program lags. Whenever I click on File, Edit, Select, View, Window, etc., my mouse lags and the availability of the menus even took longer than expected (all were gray). How do I fix this? This is so ann

  • Web Page composer : new layout does not display Page Header Links Manager

    Hello, I am currently working with Web Page Composer, and this is my issue : when using original layout, the header are displayed with "Add to favorites", "Print", "E-mail" etc... and all chosen links via the "Select Page links" link. But whith my cu

  • Declaration of subroutine formal parameters in ecc 6.0

    In extended syntax check of my program, how can i declare formal parameters ? the warning is Program:  ZADI_V_R_869_870_STATUS  Row:    751 Parameter "P_LV_UNSHIPPED_QTY" is untyped. Static type checks and optimizations, therefore, cannot take place.

  • How to store a file in a database

    Is there an easy way to "put" a file (not just the path to it, but the binary data of it...) in a database ? In other words, do exist any classes to handle a file just like a multipart attachment ? And then, in which kind of database data type is bet

  • Business Graphics - Gantt: How to customize?

    Hi! I followed this tutorial (https://cw.sdn.sap.com/cw/docs/DOC-35515 - http://help.sap.com/saphelp_nw04/helpdata/EN/a8/1cd93f5e0f9015e10000000a155106/frameset.htm) and the final result is looking very different. This is because the customizing step