Hi, to everyone.
My program to make program to write the application the input a dollar amount to be printed on a cheque, and then prints the amount with eleven position number are available for printing the cheque. And need to run the word equivalent of the cheque amount e.g.: the amount 123.30 should be written
One hundred twenty three dollars and thirty cents
My problem I don't know how to make to run the number to the word equivalent of the cheque amount. Like this
The amount 123.30 should be written as One hundred twenty three dollars and thirty cents
This is my code:
import javax.swing.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2005</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class Cheque
{
public static void main (String [] args)
{
String Q = JOptionPane.showInputDialog(null, "Please Enter the Account..");
int l;
int nn=0;
int t=0;
for (int x=1 ; x<=Q.length() ; x++)
{
if (Q.length() < 12) {
l = Q.length();
t = l - 12;
nn = t * ( -1);
}
}
System.out.println( " "+Q +"$"+" t The Cheque amount " );
System.out.println( " " + nn+ " t The positon number");
}
}
can anyone tell me how can i do that.Thank you,