5. Using the switch-case statement, write a menu driven program to do the following :
To generate and print Letters from A to Z and their Unicode
Letters
Unicode
A
65
B
66
N
90
Answers
Answer:
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String letter=sc.nextLine();
switch(letter)
{
case "A": System.out.println(" A 65");
break;
case "B": System.out.println(" B 66");
break;
case "C": System.out.println(" C 67");
break;
case "D": System.out.println(" D 68");
break;
case "E": System.out.println(" E 69");
break;
case "F": System.out.println(" F 70");
break;
case "G": System.out.println(" G 71");
break;
case "H": System.out.println(" H 72");
break;
case "I": System.out.println(" I 73");
break;
case "J": System.out.println(" J 74");
break;
case "K": System.out.println(" K 75");
break;
case "L": System.out.println(" L 76");
break;
case "M": System.out.println(" M 77");
break;
case "N": System.out.println(" N 78");
break;
case "O": System.out.println(" O 79");
break;
case "P": System.out.println(" P 80");
break;
case "Q": System.out.println(" Q 81");
break;
case "R": System.out.println(" R 82");
break;
case "S": System.out.println(" S 83");
break;
case "T": System.out.println(" T 84");
break;
case "U": System.out.println(" U 85");
break;
case "V": System.out.println(" V 86");
break;
case "W": System.out.println(" W 87");
break;
case "X": System.out.println(" X 88");
break;
case "Y": System.out.println(" Y 89");
break;
case "Z": System.out.println(" Z 90");
break;
}
}
}
Explanation:
it is a java program . Ony enter capital letters.