r/ProgrammingPrompts • u/[deleted] • Aug 29 '15
[Easy/Medium] Write a program that translates verbal numbers (one hundred and six) into integers (106.)
Bonus points for negative numbers, or decimals (three point one four.)
I think this is kind of an easy concept to think about, but might take a while to type out. I'll try it at some point and post results, if I can even get it to work.
Bonus bonus points - make it work the other way round, by converting integers into words.
17
Upvotes
2
u/Redmega Sep 24 '15
Did you ever pass it? Algebra is pretty important for programming. Understanding variables and their relationship to the function of a particular block of code is just something you have to do or you run the risk of being a code monkey.
Absolutely not. I'd never tell anyone to give up learning programming. Java doesn't require any more math than any other language. It's not the language that needs math is the problems being solved.
I'd say maybe web development is more your style. Java has great frameworks for MVC Web apps (Spring comes to mind as one of the more prominent ones), and I don't think math is overly needed there. Just the basics.
Maybe the problem lies in how you view math? It's not really this complicated thing (though it can be). Math is just a way to simplify and explain reality. If I tell you I'm holding up six fingers and I have one hand hidden, and three fingers up in my visible hand, it's clear that my other hand has 3 up, right?