How can i make the program to tell the user what letter of the alphabet it is:
ex: " k is the 11th letter in the alphabet"
here is the code that i got so far
import javax.swing.*;
public class Ncom{
String Inputnum;
char num;
public static void main(String[] args){
new Ncom();
}
public Ncom(){
char []upper = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char []lower = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
Inputnum=JOptionPane.showInputDialog("Enter a letter");
num= Inputnum.charAt(0);
if (Character.isUpperCase(num))
System.out.println(num+" is Upper case");
else
System.out.println(num+" is Lower case");
}
}
Thank you