Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Declaring an unkown user input alphanumeric array

$
0
0
I need to ask for an unknown alphanumeric String and has to show on the screen like this:

User inputs: "aa123 4p56-7890"

4
56
123
7890

So far I have this: Needs to be in two separate classes.



import java.util.Scanner;

public class Program10
{

public static void main (String[]args)
{

Scanner stdIn=new Scanner(System.in);

String [] num = new String [1000];
int eSize = 0;

System.out.println("Enter an alphanumeric string: ");
num = stdIn.nextLine();




}




//*****************************************************************************************************


//*You must write and use a method intParse to break the string into a list of integers. Its heading is

public static int[] intParse(String num)
{
int [] big = new int [1000];
int eSize=0;
int [] fit = new int [eSize];

for (int i=0; i<eSize; ++i);
fit [eSize]= big[eSize];


}return fit;

}
//*****************************************************************************************************

/*You must write and use a method intSort, which takes an array of integers and returns an new
* array which contains the same integers sorted in ascending order. The array passed in as an
* argument should not be changed
*/
public static int[] intSort(int[] s)
{
int j=0;
int s=0;
int e=0;

boolean isDigit = false;
boolean isLetter;
boolean isWhiteSpace = false;

while(!isDigit)
{
++j;
s=e=j;
}
while(isDigit)
{
++e;
s=e;
}
while(isWhiteSpace);
{
++s;
}
}

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>