# Need help writing the if statements, for a number to english converter (numbers <100)

• 03-02-2013, 04:09 AM
765891
Need help writing the if statements, for a number to english converter (numbers <100)
Need help writing the if statements, for a number to English converter for numbers less than 100?
So would i need to have negative numbers such as negative hundred or thousand or million (as far as an int can hold (excluding floats))
I haven't worked with arrays much
Little confused on what to do...
Code:

``` import java.util.*;  //import java utility package    public class Program5  {     public static void main(String[] args )     {       Scanner in = new Scanner(System.in);       String[] ones ={"Zero", " One", " Two", " Three",                           " Four", " Five",                         " Six", " Seven", " Eight", " Nine"};       String[] teens= {" Ten", " Eleven", " Twelve",                         " Thirteen", " Fourteen", " Fifteen",                         " Sixteen", " Seventeen",                         " Eighteen", " Nineteen"};       String[] tens =  {"", "Ten", " Twenty", " Thirty", " Forty", " Fifty",                           " Sixty", " Seventy", " Eighty"," Ninety"};                                 int num=0;             System.out.println("Please enter a number less than 100");       num=in.nextInt();       if(num < 100)       {                 }           }  }```
• 03-02-2013, 04:20 AM
LetsG0Blue
Re: Need help writing the if statements, for a number to english converter (numbers <
Are you trying to build a loop and end it with a 'if' statement? And are you trying to stay within 1-100?
• 03-02-2013, 04:24 AM
765891
Re: Need help writing the if statements, for a number to english converter (numbers <
Quote:

Originally Posted by LetsG0Blue
Are you trying to build a loop and end it with a 'if' statement? And are you trying to stay within 1-100?

Yes (I might try 1-100 first) And i need help guiding to the display of the word version of the number