yeup, i finally got the damn thing to work. thanks for your help norm. much appreciated man.
Type: Posts; User: ThePrince
yeup, i finally got the damn thing to work. thanks for your help norm. much appreciated man.
yeup! i finally got it to work, but I'm having one last problem..
the program is supposed to keep running until 999999999 is entered
so if i create a while loop for example:
while...
okay it works now, but how would i throw this all into a loop. i don't get how i would be able to set up a for loop and have it check if each number doubled is greater than 9 and then individually...
the teacher was absent that day and we were expected to learn the lesson ourselves!:(
so what do you think i should do? subtract it by 0 after the if (num1>9) or before?
@myjava okay i'll try your code out! thanks man
--- Update ---
//Start the process
i copy and pasted it into the compiler and got '8' =56
so i would have to subtract '8' by 0 to get 8?
woah, i checked the value of num1 and i got 112!!
any thoughts on why? :|
and yeah, ill do that for sure next time!
okay thanks so much! but why is it that when i put down 888888888 as the SIN number, and do this
char c1 = SIN.charAt(1);
char c2 = SIN.charAt(3);
char c3 = SIN.charAt(5);...
// Prompt for SIN Card number as string, convert to integer to get check digit, output the check digit, convert back to string for proccess
System.out.println("Please enter your SIN card number:...
char c1 = SIN.charAt(1);
char c2 = SIN.charAt(3);
char c3 = SIN.charAt(5);
char c4 = SIN.charAt(7);
int num1 = c1*2;
if (num1>9){
Integer.toString(num1);
char num1_1 =...
i'm a java noob... could you get my program started? like just until the loop cause i tried to put it as a string but i don't know how i would get the 2nd, 4th, 6th, 8th digits out of it! im...
what do you suggest would be the best way to do it
i don't know how to convert it to from a int to a string then back ...
yeah you can do that! my teacher said you're allowed to do anything as long as it's in a loop but i dont know how to do it.. like i know the syntax but don't know how to apply it here.
i don't know how to get each digit on it's own... i tried %10 to get the last digit but i don't understand how i would throw this all into a for loop!
i tried at least 50 times for this code to work and i just can't get it to work. can someone tell me how to do it?
Assignment - Repetition
In the nine-digit Social Insurance Number given to...