+ 6

Write a program in java that when I give input as number,it should give output in words...

for example .......enter a number:4923578 forty nine lakhs twenty three thousand five hundred seventy eight

5th Feb 2018, 1:57 PM
Keerthana Vema
Keerthana Vema - avatar
7 odpowiedzi
7th Feb 2018, 2:39 PM
Chandrajeet Varma
Chandrajeet Varma - avatar
+ 9
I'm an exception to the rules. Coding is more understandable to me than my native English. I knew more about my first language than my teachers and had my first programming job in a second language in a week. I've fixed programs and coded programs in languages I don't know the first day. I haven't learned Kotlin as yet, but I could code anything in it.
5th Feb 2018, 5:41 PM
John Wells
John Wells - avatar
+ 8
One of the first programs I ever wrote was output a check based on user's input of name and amount for my Fortran class. It took under an hour to write so shouldn't be very hard for you to code this little piece of it. I promise to help you get it working, if you code something reasonable.
5th Feb 2018, 2:35 PM
John Wells
John Wells - avatar
+ 7
As you should be able to see in the Python code, you need the words in arrays so you can look them up. The other thing you need is to split the number into digits. The Python code doesn't make it easy to convert to Java so: // num is input value while (num > 0) { int digit = num % 10; // digit to process num /= 10; // remove the digit // store it in array or convert to word } If you store in array, you can process the digits from highest used digit column to 1's column afterwards. Otherwise, you convert 1's column first, ten's column next, etcetera, stuffing in front of the currently filled in string.
7th Feb 2018, 3:52 PM
John Wells
John Wells - avatar
+ 6
make one yourself😂😂😂 what's the logic of learning to code then!😕😕
5th Feb 2018, 2:00 PM
Akib
Akib - avatar
+ 1
how many days took you to be more then the basic learner sir
5th Feb 2018, 4:37 PM
Shivam Raj
Shivam Raj - avatar
+ 1
wow!
5th Feb 2018, 5:42 PM
Shivam Raj
Shivam Raj - avatar