Java
Hotmess * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package poker;
public class Card {
private int suit, value;
private String[] cardSuit = {"Spades", "Diamonds", "Hearts", "Clubs"};
private String[] cardValue = { "2", "3", "4", "5",
"6", "7", "8", "9", "10", "Joker", "King", "Queen","Ace"};
public Card(int cSuit, int cValue) {
if(cSuit<0||cSuit>3){
throw new IllegalArgumentException("Suit int must be between 0 and 3");
}
if(cValue<0||cValue>12){
throw new IllegalArgumentException("value int must be between 0 and 12");
}
suit = cSuit;
value = cValue;
}
public int getSuit(){
return suit;
}
public int getValue(){
return value;
}
public String toString() {
String cardInfo = cardValue[value] + " of " + cardSuit[suit];
return cardInfo;
}
public String getImage(){
return "/images/"+cardValue[value]+cardSuit[suit]+".png";
}
}
- 2 years ago
- 10
Purchase the answer to view it
- publicclassCard_javax.docx
- Heathcare8_disc
- Learning Team Communication Challenges Conversation
- Paper on Addiction
- Ethical Issues in Information Technology *****Already A++ Rated Tutorial*****Use as Guide Paper*****
- Life Stages Nutrition Presentation.... Part 2 Food Safety
- HIS 135 Week 7 Political Commentary Interview
- Due today 4$ !!
- 2 Corinthians
- miss prof
- analysis of documentary/movie