mercredi 30 octobre 2019

How can i display the suit variable like ( Suit is: XXXXX (Hearts, Clubs, Spades, Diamonds))?

class Card
{ private: int value; // stores value of card(1,2,3,4,5,6,7,8,9,0) char suit; // stores suit of card('h','d','s','c' char card; // stores card symbol(1,2,3,4,5,6,7,8,9,0,k,q,j,a)

public:


    void setValue(int v)         {value = v;}  
    void setCard(char c)         {card = c;} 
    void setSuit(char s)         {suit = s;} 


    int getValue()        {return value;} 
    char getSuit()        {return suit;} 
    char getCard()        {return card;} 

    void display();

};

void Card :: display() // display member function {

cout << "Value is: " << getValue() << endl; 
cout << "Suit is : " << getSuit() << endl; 


cout << "Card is: " << getCard() << endl;

}

Aucun commentaire:

Enregistrer un commentaire