I'm needing to create a program that will run through a series of math functions to determine whether a number is valid or not.
It starts out prompting the user to enter his/her card number
System.out.print( "Enter Card# " );
cardnumber = MyInput.readDouble( );
Very simple,
But after I get the cardnumber I need a way to tell how long the card number is... is it 10 digits long? 15 digits long?
and then can I build an array from card number that would seperate each of the digits?
so if the user enters 202021
private double [ ] newarray = {2,0,2,0,2,1};
So to restate I'm trying to count the number of digits in an int variable.
and I want to to build an array based on a variable.
maybe my brain will work better in the morning
It starts out prompting the user to enter his/her card number
System.out.print( "Enter Card# " );
cardnumber = MyInput.readDouble( );
Very simple,
But after I get the cardnumber I need a way to tell how long the card number is... is it 10 digits long? 15 digits long?
and then can I build an array from card number that would seperate each of the digits?
so if the user enters 202021
private double [ ] newarray = {2,0,2,0,2,1};
So to restate I'm trying to count the number of digits in an int variable.
and I want to to build an array based on a variable.