Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Β© A+ Computer Science - www.apluscompsci.com
- //Name -
- //Date -
- //Class -
- //Lab -
- import static java.lang.System.*;
- import java.util.Scanner;
- public class CharacterAnalyzer
- {
- private char theChar;
- public CharacterAnalyzer()
- {
- theChar = 'c' ;
- }
- public CharacterAnalyzer(char c)
- {
- theChar = c;
- }
- public void setChar(char c)
- {
- theChar = c;
- }
- public char getChar()
- {
- //what?
- return '-';
- }
- public boolean isUpper( )
- {
- if (theChar > 64 ){
- return true;
- }if (theChar < 91){
- return false;
- }
- return false;
- }
- public boolean isLower( )
- {
- if (theChar > 96 ){
- return true;
- }if (theChar < 123){
- return false;
- }
- return false;
- }
- public boolean isNumber( )
- {
- return false;
- }
- public int getASCII( )
- {
- int ascii = theChar;
- return 0;
- }
- public String toString()
- {
- return ""+getChar() + " is a lowercase character. ASCII == " + getASCII() + "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement