Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * Jared Bergan Feb 13, 2017 Card.java This program will
- *
- */
- public class Card {
- private int value;
- private char suit;
- public Card() {
- value = 0;
- suit = '\0';
- }
- public Card(int v, char s) {
- value = v;
- suit = s;
- }
- public void setValue(int v)
- {
- value = v;
- }
- public void setSuit(char s)
- {
- suit = s;
- }
- public int getValue()
- {
- return value;
- }
- public char getSuit()
- {
- return suit;
- }
- public String toString()
- {
- if(this.getValue()==1)
- return ("a"+suit).toUpperCase();
- else if(this.getValue()==11)
- return ("j"+suit).toUpperCase();
- else if(this.getValue()==12)
- return ("q"+suit).toUpperCase();
- else if(this.getValue()==13)
- return ("k"+suit).toUpperCase();
- else
- return (""+this.getValue()+this.getSuit()).toUpperCase();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement