|
ex3-11c.cpp - Example 3-11 Multi-file application - card source file |
// File: ex3-11c.cpp card class member function definitions
#include <iostream>
using namespace std;
#include "ex3_11c.h"
const char* value_name[13] =
{"two","three","four","five","six",
"seven","eight","nine","ten","jack","queen","king","ace"};
const char* suit_name[4] =
{"clubs","diamonds","hearts","spades"};
int card::get_value(void) const
{
return value;
}
int card::get_suit(void) const
{
return suit;
}
void card::assign(int x)
{
value = x % 13;
suit = x / 13;
return;
}
void card::print(void) const
{
cout << (value_name[value]) << " of "
<< (suit_name[suit]) << endl;
return;
}
CIS27: Programming in C++ Instructor: Joe Bentley