I have to do a numerology program for my
Java class. The program takes as input the user's birthdate and name. The date has to be in mm/dd/yy format. Then we are supposed to break down the number, adding the digits of the date together, until it is a single digit, i.e., between 0 and 9.
My question is: what is the best way to do the conversion from
String to individual ints? Or should I break the String down into constituent Strings? Someone suggested I do that, and then copy them into an array. I am not sure of the best way to do this. Basically, I just want to take a date, like 11/03/78 and add the individual numbers together, reducing them to one number, like this:
1 + 1 + 0 + 3 + 7 + 8 = 20 = 2 + 0 = 2