Introduction to OOP: Chapter 3: Classes and Methods: [next] [previous] [audio] [real] [text]

Implementation of the card abstraction

//
//	implementation file
//	for playing card abstraction
//

# include "card.h"

Card::Card (suits sv, int rv)
{
	s = sv;		// initialize suit
	r = rv;		// initialize rank
	faceup = true;	// initially face up
}

int Card::rank()
{
	return r;
}
Intro OOP, Chapter 3, Slide 22