-
Notifications
You must be signed in to change notification settings - Fork 0
/
Random_Code_Generator.java
56 lines (56 loc) · 1.46 KB
/
Random_Code_Generator.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import java.util.Random;
public class Random_Code_Generator {
public static void main(String[] args) {
Random rand = new Random();
int letter = rand.nextInt(25);
int letter1 = rand.nextInt(25);
int letter2= rand.nextInt(25);
int letter3 = rand.nextInt(25);
int letter4 = rand.nextInt(25);
char alph = 'a';
char alph1 = 'a';
char alph2 = 'a';
char alph3 = 'a';
char alph4 = 'a';
for (int i = -1;i<=25;i++){
if (i == letter){
alph++;
break;
}
alph++;
}
for (int i = -1;i<=25;i++){
if (i == letter1){
alph1++;
break;
}
alph1++;
}
for (int i = -1;i<=25;i++){
if (i == letter2){
alph2++;
break;
}
alph2++;
}
for (int i = -1;i<=25;i++){
if (i == letter3){
alph3++;
break;
}
alph3++;
}
for (int i = -1;i<=25;i++){
if (i == letter4){
alph4++;
break;
}
alph4++;
}
System.out.print(alph);
System.out.print(alph1);
System.out.print(alph2);
System.out.print(alph3);
System.out.print(alph4);
}
}