I am given a vague question that says - design and implement a class to represent a playing card, that can be used to play card games. Consider what information you needs to be stored in a card and what you man want to do with a card (accessors/mutators). 2 files are required - card.h and card.cpp.
My impression of this question is that I will need to shuffle then draw a card out of a deck (52 cards). While doing so, I will also need to display the contents of the drawn card only. Can I assume it as such?
So far in my written header file below, I am using array. Is that the best way to go about?
What I have tried:
#ifndef CARD_H
#define CARD_H
#include<string>
#include<iostream>
using namespace std;
class Card
{
private:
string suits[4] = {"Hearts", "Diamond", "Clubs". "Spades"};
string values[13] = {"Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
public:
Card();
Card(string cardSuit, string cardValue);
void draw();
void display();
};
#endif