Shavit

Lowercase Letter

Oct 6th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. // Shavit Borisov
  2. // CW
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class Char {
  7.  
  8.     public static void main(String[] args)
  9.     {
  10.         Scanner in = new Scanner (System.in);
  11.        
  12.         System.out.println("Enter a char:");
  13.             char ch = in.next().charAt(0);
  14.        
  15.         System.out.println("Your lowercase letter is: " + ch);
  16.         System.out.println("The next letter is: " + (char)(ch + 1));
  17.         System.out.println("The capital of your letter is: " + (char)(ch - ('a' - 'A')));
  18.        
  19.         in.close();
  20.     }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment