Guest User

Untitled

a guest
Jan 23rd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. /**
  2. * This class will return info on the input of the user
  3. *
  4. *Matt Mueller
  5. *10/17/06
  6. */
  7.  
  8. public class Card
  9. {
  10. private String input;
  11.  
  12.  
  13. public Card(String userInput)
  14. {
  15. input = userInput;
  16. }
  17.  
  18. public String getDescription()
  19. {
  20. String description;
  21. //aces
  22. if (input.equalsIgnoreCase("AD"))
  23. description = "Ace of Diamonds";
  24.  
  25. if (input.equalsIgnoreCase("AH"))
  26. description = "Ace of Hearts";
  27.  
  28. if (input.equalsIgnoreCase("AS"))
  29. description = "Ace of Spades";
  30.  
  31. if (input.equalsIgnoreCase("AC"))
  32. description = "Ace of Clubs";
  33.  
  34. //twos
  35. if (input.equalsIgnoreCase ("2D"))
  36. description = "Two of Diamonds;
  37.  
  38. if (input.equalsIgnoreCase ("2H"))
  39. description = "Two of Hearts;
  40.  
  41. if (input.equalsIgnoreCase ("2S"))
  42. description = "Two of Spades;
  43.  
  44. if (input.equalsIgnoreCase ("2C"))
  45. description = "Two of Clubs;
  46.  
  47. //threes
  48. }
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. }
Add Comment
Please, Sign In to add comment