-
Notifications
You must be signed in to change notification settings - Fork 164
/
ABCDERIAN.java
33 lines (28 loc) · 979 Bytes
/
ABCDERIAN.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
import java.util.Scanner;
public class ABCDERIAN {
public static void main(String[] args) {
Scanner masuk = new Scanner(System.in);
String kata;
int panjangkata;
int panjangalpha;
int a = 0;
String alphabet = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz";
System.out.println("==ABCDERIAN Program==");
System.out.print("Input word : ");
kata = masuk.nextLine();
masuk.close();
panjangkata = kata.length();
panjangalpha = alphabet.length();
//System.out.println(panjangalpha);
for(int i = 0; i < panjangalpha; i++){
if(kata.charAt(a) == alphabet.charAt(i)){
a++;
if(a == panjangkata){
System.out.println("Word '"+kata+"' is ABCDERIAN");
return;
}
}
}
System.out.println("Word '"+kata+"' is not ABCDERIAN");
}
}