Question: It is C++ assignment. // my Deck of Card Lab #include #include #include using namespace std; enum Suit{ Spade,Heart ,Diamond,Club }; class card{ private: int

It is C++ assignment.

 It is C++ assignment. // my Deck of Card Lab #include

// my Deck of Card Lab

#include #include  #include  using namespace std; enum Suit{ Spade,Heart ,Diamond,Club }; class card{ private: int number; int suit; string description; public: card(){} void setNumber( int n){ number=n; } void setSuit( int s){ suit=s; } void setDescription(){ char ch ; string str="";//here string was not initialized to empty if(number>=2&&numbercout cout cout  Streams Lab 1) Start with your code for the Deck of Cards Lab. You will need a Card class with member variables suit, number, and description, and an array of 52 Card objects. 'Pad' all descriptions with blanks so that they are the same length. Write all 52 descriptions to a file in text format, with a 'new line' character after each. Close the file Open your file with Notepad (Windows) or TextEdit (Mac) and confirm that it has been written correctly. 2) Now write a second program Open the file. Ask the user for a number of a card, from 1 to 52 Use the seekg() member function to find the requested card in the file . Read the description of the requested card and display it on the console.  Streams Lab 1) Start with your code for the Deck of Cards Lab. You will need a Card class with member variables suit, number, and description, and an array of 52 Card objects. 'Pad' all descriptions with blanks so that they are the same length. Write all 52 descriptions to a file in text format, with a 'new line' character after each. Close the file Open your file with Notepad (Windows) or TextEdit (Mac) and confirm that it has been written correctly. 2) Now write a second program Open the file. Ask the user for a number of a card, from 1 to 52 Use the seekg() member function to find the requested card in the file . Read the description of the requested card and display it on the console

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!