Fall 2018 Class CS265 Quiz 1 Name a) Write a class Card, described below. Descri
ID: 3744047 • Letter: F
Question
Fall 2018 Class CS265 Quiz 1 Name a) Write a class Card, described below. Description of Card class: Instance variables: a string suit to hold the suit of a card in a deck of playing cards an integer face to hold the face of a card in a deck of playing cards o o Function members: an explicit constructor which initializes the object to a Card with given suit and face. o receives: a suit and a face an accessor(get operation) GetSuit() returns the card's suit a comparison function isLessThan() o o receives another Card object C returns: true if and only if card C's face value is greater, otherwise false * b) test all of the member functions inside m ain() function.Explanation / Answer
#include #include using namespace std; class Card { private: string suit; int face; public: Card(string s, int f) { suit = s; face = f; } string GetSuit() { return suit; } bool isLessThan(Card c) { return faceRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.