* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java


 * 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”;
}

}

Table of Contents

Calculate your order
Pages (275 words)
Standard price: $0.00

Latest Reviews

Impressed with the sample above? Wait there is more

Related Questions

Global Supply Chain Logistics

Description Question 1: Global Supply Chain Logistics 1a. Discuss why the supply chains of organizations are increasingly becoming global. Give at least four benefits associated

New questions

Don't Let Questions or Concerns Hold You Back - Make a Free Inquiry Now!