Advertisement
RazorBlade57

Charanalyzer

Nov 2nd, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. //Β© A+ Computer Science  -  www.apluscompsci.com
  2. //Name -
  3. //Date -
  4. //Class -
  5. //Lab  -
  6.  
  7. import static java.lang.System.*;
  8. import java.util.Scanner;
  9.  
  10. public class CharacterAnalyzer
  11. {
  12.     private char theChar;
  13.  
  14.     public CharacterAnalyzer()
  15.     {
  16.         theChar = 'c' ;
  17.     }
  18.  
  19.     public CharacterAnalyzer(char c)
  20.     {
  21.         theChar = c;
  22.     }
  23.  
  24.     public void setChar(char c)
  25.     {
  26.         theChar = c;
  27.     }
  28.  
  29.     public char getChar()
  30.     {
  31.         //what?
  32.         return '-';
  33.     }
  34.  
  35.     public boolean isUpper( )
  36.     {
  37.         if (theChar > 64 ){
  38.             return true;
  39.         }if (theChar < 91){
  40.             return false;
  41.         }
  42.         return false;
  43.     }
  44.  
  45.     public boolean isLower( )
  46.     {
  47.         if (theChar > 96 ){
  48.             return true;
  49.         }if (theChar < 123){
  50.             return false;
  51.         }
  52.         return false;
  53.     }
  54.    
  55.     public boolean isNumber( )
  56.     {
  57.         return false;
  58.     }  
  59.  
  60.     public int getASCII( )
  61.     {
  62.         int ascii = theChar;
  63.         return 0;
  64.     }
  65.  
  66.     public String toString()
  67.     {
  68.         return ""+getChar() + " is a lowercase character. ASCII == " + getASCII() + "\n";    
  69.     }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement