Listing PG2.cpp... //Ben Harris //This program shuffles a deck of cards, deals ten hands of five, //then checks for poker hands excluding straight, flush, and straight flush #include #include #include #include "time.h" #include "PG2.h" using namespace std; int main (int argc, char **argv){//main method //initialize deck and randomize it srand((unsigned)time(0)); int *deck = new int[52]; for(int i=0;i<52;i++){ deck[i]=i; } shuffle(deck); //start to deal the hands for(int j = 0; j<10;j++){//deals ten hands int rankcount[13] = {0}; for(int i = j*5;i 1)return true; else return false; } Listing PG2.h... //Ben Harris //Header file for PG2 #ifndef _PG2_ #define _PG2_ #include #include #include using namespace std; int main (int argc, char **argv); string getSuitName(int card); string getRankName(int card); void swapTwo(int a, int b,int *d); void shuffle(int *d); bool inArray(int *d,int toinsert, int sz); bool dupeinarray(int *d, int dupetocheck, int sz); #endif Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\apoe\Desktop\Grading Folder>cppcompileall PG2.exe Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\apoe\Desktop\Grading Folder>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 Setting environment for using Microsoft Visual Studio 2010 x86 tools. C:\Users\apoe\Desktop\Grading Folder>cl /Tp "PG2.cpp" /O2 /EHsc /W2 /Za /link /OUT:PG2.exe PG2.cpp Microsoft (R) Incremental Linker Version 10.00.40219.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:PG2.exe /OUT:PG2.exe PG2.obj C:\Users\apoe\Desktop\Grading Folder>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. C:\Users\apoe\Desktop\Grading Folder>PG2.exe Six of Clubs Ace of Spades Five of Hearts Ten of Clubs Six of Hearts ONE PAIR King of Hearts Two of Hearts Six of Diamonds Eight of Diamonds Seven of Spades NOTHING King of Clubs Four of Diamonds Seven of Diamonds Two of Hearts Jack of Hearts NOTHING Five of Clubs Queen of Clubs Nine of Spades Two of Diamonds Queen of Spades ONE PAIR Five of Diamonds Nine of Clubs Three of Diamonds Five of Spades Ten of Spades ONE PAIR Four of Spades Six of Spades Four of Hearts Eight of Clubs King of Diamonds ONE PAIR Two of Spades Jack of Diamonds Ace of Diamonds Seven of Clubs Ace of Clubs ONE PAIR Queen of Hearts Three of Spades Seven of Hearts Eight of Hearts Ace of Hearts NOTHING Ten of Hearts Ten of Diamonds Three of Clubs Four of Clubs Three of Hearts TWO PAIR Queen of Diamonds Jack of Clubs Nine of Diamonds Eight of Spades Jack of Spades ONE PAIR Press any key to continue . . . C:\Users\apoe\Desktop\Grading Folder>tart /wait timeout 2 'tart' is not recognized as an internal or external command, operable program or batch file. C:\Users\apoe\Desktop\Grading Folder>PG2.exe Six of Clubs Ace of Spades Five of Hearts Ten of Clubs Six of Hearts ONE PAIR King of Hearts Two of Hearts Six of Diamonds Eight of Diamonds Seven of Spades NOTHING King of Clubs Four of Diamonds Seven of Diamonds Two of Hearts Jack of Hearts NOTHING Five of Clubs Queen of Clubs Nine of Spades Two of Diamonds Queen of Spades ONE PAIR Five of Diamonds Nine of Clubs Three of Diamonds Five of Spades Ten of Spades ONE PAIR Four of Spades Six of Spades Four of Hearts Eight of Clubs King of Diamonds ONE PAIR Two of Spades Jack of Diamonds Ace of Diamonds Seven of Clubs Ace of Clubs ONE PAIR Queen of Hearts Three of Spades Seven of Hearts Eight of Hearts Ace of Hearts NOTHING Ten of Hearts Ten of Diamonds Three of Clubs Four of Clubs Three of Hearts TWO PAIR Queen of Diamonds Jack of Clubs Nine of Diamonds Eight of Spades Jack of Spades ONE PAIR Press any key to continue . . . C:\Users\apoe\Desktop\Grading Folder>tart /wait timeout 2 'tart' is not recognized as an internal or external command, operable program or batch file. C:\Users\apoe\Desktop\Grading Folder>PG2.exe Six of Clubs Ace of Spades Five of Hearts Ten of Clubs Six of Hearts ONE PAIR King of Hearts Two of Hearts Six of Diamonds Eight of Diamonds Seven of Spades NOTHING King of Clubs Four of Diamonds Seven of Diamonds Two of Hearts Jack of Hearts NOTHING Five of Clubs Queen of Clubs Nine of Spades Two of Diamonds Queen of Spades ONE PAIR Five of Diamonds Nine of Clubs Three of Diamonds Five of Spades Ten of Spades ONE PAIR Four of Spades Six of Spades Four of Hearts Eight of Clubs King of Diamonds ONE PAIR Two of Spades Jack of Diamonds Ace of Diamonds Seven of Clubs Ace of Clubs ONE PAIR Queen of Hearts Three of Spades Seven of Hearts Eight of Hearts Ace of Hearts NOTHING Ten of Hearts Ten of Diamonds Three of Clubs Four of Clubs Three of Hearts TWO PAIR Queen of Diamonds Jack of Clubs Nine of Diamonds Eight of Spades Jack of Spades ONE PAIR Press any key to continue . . . C:\Users\apoe\Desktop\Grading Folder>xit 'xit' is not recognized as an internal or external command, operable program or batch file. C:\Users\apoe\Desktop\Grading Folder> Get rid of the system ("pause"). Also, use delete[] to delete an array. 35/50. Fix by Wednesday 8 October 2014.