#include #include #include #include #include #include "card.h" #include "deck.h" #include "hand.h" using namespace std; /************************************************************ * FunctionName * * Function description * * * * * ************************************************************/ int main() { string repeat = "Y"; Deck myDeck; Hand myHand; string exchangeCards; while (repeat == "Y" || repeat == "y") { cout << endl; myHand.newHand(myDeck); myHand.print(); cout << endl; cout << "Would you like to exchange any cards? [Y / N]: "; getline(cin, exchangeCards); while (exchangeCards != "Y" && exchangeCards != "y" && exchangeCards != "X" && exchangeCards != "n") { cout << "Please enter Y or N only: "; getline(cin, exchangeCards); } if (exchangeCards == "Y" || exchangeCards == "y") { myHand.exchangeCards(myDeck); } cout << endl; myHand.print(); cout << endl; myDeck.reset(); // Resets the deck for a new game cout << "Play again? [Y / N]: "; getline(cin, repeat); while (repeat != "Y" && repeat != "y" && repeat != "N" && repeat != "n") { cout << "Please enter Y or N only: "; getline(cin, repeat); } } return 0; }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I already know how to program. I go passed a programming class already. I had to take another one and I can't figure out this error. The last one was boolean. it needed to be == instead of =. 

exchangeCards == "Y".

 

#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include <sstream>

#include "card.h"
#include "deck.h"
#include "hand.h"

using namespace std;

/************************************************************
* FunctionName *
* Function description *
* *
* *
************************************************************/
int main()
{
string repeat = "Y";
Deck myDeck;
Hand myHand;
string exchangeCards;

while (repeat == "Y" || repeat == "y")
{
cout << endl;

myHand.newHand(myDeck);
myHand.print();
cout << endl;

cout << "Would you like to exchange any cards? [Y / N]: ";
getline(cin, exchangeCards);

while (exchangeCards != "Y" && exchangeCards != "y" && exchangeCards != "X" && exchangeCards != "n")
{
cout << "Please enter Y or N only: ";
getline(cin, exchangeCards);

}

if (exchangeCards == "Y" || exchangeCards == "y")
{
myHand.exchangeCards(myDeck);
}
cout << endl;

myHand.print();

cout << endl;

myDeck.reset(); // Resets the deck for a new game

cout << "Play again? [Y / N]: ";
getline(cin, repeat);
while (repeat != "Y" && repeat != "y" && repeat != "N" && repeat != "n")
{
cout << "Please enter Y or N only: ";
getline(cin, repeat);

}

}

return 0;
}

 

myDeck.reset is where it won't compile. You answered my question right before, I apollogize but I thought you needed code that you didn't need. Now I can provide you with the additional code if you reject the question but in order for me to understand this next step, I need to see it. I can only understand c++ when working with others on it at the same time.

A main.cpp - Code:Blocks 20.03
X
File Edit View Search Project Build Debug Fortran wxSmith
Tools Tools+ Plugins DoxyBlocks Settings Help
/** *<
S C
| <global>
vmain) : int
Management
Start here X main.cpp x deck.cpp X
Projects
FSymbols
Files
string repeat = "Y";
Deck myDeck;
29
Workspace
30
31
Hand myHand;
32
string exchangeCards;
33
34
while (repeat == "Y" || repeat == "y")
35
36
cout << endl;
37
38
myHand.newHand (myDeck) ;
myHand.print ();
cout << endl;
39
40
41
42
cout << "Would you like to exchange any cards? [Y / N]: ";
43
getline (cin, exchangeCards);
44
45
while (exchangeCards != "y" && exchangeCards != "y" && exchangeCards != "X" && exchangeCards != "n")
46
{
47
cout << "Please enter Y or N only: ";
48
getline (cin, exchangeCards);
49
50
51
52
if (exchangeCards == "y" || exchangeCards == "y")
53
{
54
myHand.exchangeCards (myDeck) ;
55
56
cout << endl;
57
58
myHand.print ();
cout << endl;
61
62 O
myDeck.reset () ;
// Resets the deck for a new game
63
cout << "Play again? [Y / N]: ";
getline (cin, repeat);
64
65
Logs & others
2 Code:Blocks x
Q Search results X
A Cccc X
Ở Build log X
P Build messages x CppCheck/Vera++ X 2 CppCheck/Vera++ messages X Cscope X
Z DoxyBlocks X
F Fortran info x
Closed files list X
Q Thread search x
File
Line
Message
=== Build file: "no target" in "no project" (compiler: unknown)
===
C:\Users\cccc...
In function 'int main ()':
C:\Users\ccee...
62
error: 'class Deck' has no member named 'reset'; did you mean 'resetDeck'?
=== Build failed: 1 error (s), 0 warning (s) (0 minute (s), 0 second (s)) ===
C:\Users\cccccc\Documents\Assignment 2\main.cpp
C/C++
Windows (CR+LF)
WINDOWS-1252 Line 59, Col 1, Pos 1497
Insert
Read/Write default
Transcribed Image Text:A main.cpp - Code:Blocks 20.03 X File Edit View Search Project Build Debug Fortran wxSmith Tools Tools+ Plugins DoxyBlocks Settings Help /** *< S C | <global> vmain) : int Management Start here X main.cpp x deck.cpp X Projects FSymbols Files string repeat = "Y"; Deck myDeck; 29 Workspace 30 31 Hand myHand; 32 string exchangeCards; 33 34 while (repeat == "Y" || repeat == "y") 35 36 cout << endl; 37 38 myHand.newHand (myDeck) ; myHand.print (); cout << endl; 39 40 41 42 cout << "Would you like to exchange any cards? [Y / N]: "; 43 getline (cin, exchangeCards); 44 45 while (exchangeCards != "y" && exchangeCards != "y" && exchangeCards != "X" && exchangeCards != "n") 46 { 47 cout << "Please enter Y or N only: "; 48 getline (cin, exchangeCards); 49 50 51 52 if (exchangeCards == "y" || exchangeCards == "y") 53 { 54 myHand.exchangeCards (myDeck) ; 55 56 cout << endl; 57 58 myHand.print (); cout << endl; 61 62 O myDeck.reset () ; // Resets the deck for a new game 63 cout << "Play again? [Y / N]: "; getline (cin, repeat); 64 65 Logs & others 2 Code:Blocks x Q Search results X A Cccc X Ở Build log X P Build messages x CppCheck/Vera++ X 2 CppCheck/Vera++ messages X Cscope X Z DoxyBlocks X F Fortran info x Closed files list X Q Thread search x File Line Message === Build file: "no target" in "no project" (compiler: unknown) === C:\Users\cccc... In function 'int main ()': C:\Users\ccee... 62 error: 'class Deck' has no member named 'reset'; did you mean 'resetDeck'? === Build failed: 1 error (s), 0 warning (s) (0 minute (s), 0 second (s)) === C:\Users\cccccc\Documents\Assignment 2\main.cpp C/C++ Windows (CR+LF) WINDOWS-1252 Line 59, Col 1, Pos 1497 Insert Read/Write default
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY