Hey guys, new to the forum. So sorry if i am posting this in the wrong location.
To my question:
I am trying to create a random password generator, and I think it's
done is this way. I have made four arrays, two for the alphabet (capital letters and not), one for 50 different numbers(or more) and one for miscellaneous signs.
This is about how far I've come, and i need your help with the rest of this, my guess would be that i need to 'draw' say four letters, one number and one sign. The user is supposed to be able to enter the length of the password himself. But I might be able to solve that on my own.
Thanks in advance.
package pass;
import java.util.*;
public class Main {
public static void main(String[] args) {
print();
}
public static void print(){
list();
System.out.println("");
System.out.println(misc());
System.out.println(Alfa1());
System.out.println(Alfa2());
}
public static int[] list(){
int nList1 [] = new int [50];
for(int i = 0; i < nList1.length; i ++)
{
nList1[i] = i+1;
}
for(int i = 0; i < nList1.length; i++)
{
System.out.print(nList1[i] + " ");
}
return nList1;
}
public static char[] misc(){
char cList1 [] = new char [14];
int nMisc = 32;
for(int i = 0; i < cList1.length; i ++)
{
nMisc++;
cList1[i] = (char) nMisc;
}
return cList1;
}
public static char[] Alfa1()
{
char cAlfa1 [] = new char [26];
int letters = 63;
for(int i = 0; i < cAlfa1.length; i ++)
{
letters++;
cAlfa1[i] = (char) (letters+1);
}
return cAlfa1;
}
public static char[] Alfa2()
{
char cAlfa2 [] = new char [26];
int letters = 96;
for(int i = 0; i < cAlfa2.length; i++)
{
letters++;
cAlfa2[i] = (char) letters;
}
return cAlfa2;
}
}