Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Number {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Please enter a number 0-25: ");
- double num = input.nextInt();
- System.out.println("You have entered " + num);
- if (num == 0)
- System.out.println("Character of the alphabet is: A");
- if (num == 1)
- System.out.println("Character of the alphabet is: B");
- if (num == 2)
- System.out.println("Character of the alphabet is: C");
- if (num == 3)
- System.out.println("Character of the alphabet is: D");
- if(num == 4)
- System.out.println("Character of the alphabet is: E");
- if(num == 5)
- System.out.println("Character of the alphabet is: F");
- if(num == 6)
- System.out.println("Character of the alphabet is: G");
- if(num == 7)
- System.out.println("Character of the alphabet is: H");
- if(num == 8)
- System.out.println("Character of the alphabet is: I");
- if(num == 9)
- System.out.println("Character of the alphabet is: J");
- if(num == 10)
- System.out.println("Character of the alphabet is: K");
- if(num == 11)
- System.out.println("Character of the alphabet is: L");
- if(num == 12)
- System.out.println("Character of the alphabet is: M");
- if(num == 13)
- System.out.println("Character of the alphabet is: N");
- if(num == 14)
- System.out.println("Character of the alphabet is: O");
- if(num == 15)
- System.out.println("Character of the alphabet is: P");
- if(num == 16)
- System.out.println("Character of the alphabet is: Q");
- if(num == 17)
- System.out.println("Character of the alphabet is: R");
- if(num == 18)
- System.out.println("Character of the alphabet is: S");
- if(num == 19)
- System.out.println("Character of the alphabet is: T");
- if(num == 20)
- System.out.println("Character of the alphabet is: U");
- if(num == 21)
- System.out.println("Character of the alphabet is: V");
- if(num == 22)
- System.out.println("Character of the alphabet is: W");
- if(num == 23)
- System.out.println("Character of the alphabet is: X");
- if(num == 24)
- System.out.println("Character of the alphabet is: Y");
- if(num == 25)
- System.out.println("Character of the alphabet is: X");
- if(num > 25)
- System.out.println("Outside of acceptable range");
- // 1 = B; 20 == U; 1000 = Outside of acceptable range; 500000000000 = Outside of acceptable range; -500000000000 = Error ;
- //12,345 = Outside of acceptable range; 789.543 = Error ; -0 = A
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement