Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

It is time for you to submit your finished Yahtzee game. Remember that your fina

ID: 667293 • Letter: I

Question

It is time for you to submit your finished Yahtzee game. Remember that your final game must be fully functional and able to be played by at least one user. Your Yahtzee game should also include the following:

Applies strings, loops, expressions, functions and variables where necessary.

C++ code that programs a random number generator for the dice.

Accurate calculations of points scored by each of the players.

Keeps the high score of the players for each game, and ranks them in order.

HI,

IT WOULD BE NICE IF I COULD GET HELP WITH THIS ASSIGNMENT BUT I DONT WANT ANSWERS FOUND FROM OTHER WEBSITES AND PASTED ON.

THANKS

This is what I have so far: I'am missing the rest of th game;;

#include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include <string>
#include <ctime>
using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
   srand(time(0));
   int firstRoll = rand() % 6 + 1;
   int secondRoll = rand() % 6 + 1;
   int thirdRoll = rand() % 6 + 1;
   int fourthRoll = rand() % 6 + 1;
   int fifthRoll = rand() % 6 + 1;
   int Dicerolls[5];
   int   Dicerolls = rand() % 6 + 1;
  
   int straight = 0;
   int NumCount[6] = { 0 };

  
   string DieNames[6] = { "ones", "twos", "threes", "fours", "fives", "sixes"};
   bool TwoKind = false, ThreeKind = false, FourKind = false, FiveKind = false;

   cout << "Roll 5 dice. Enter the roll dice." << endl;
   for (unsigned int i = 0; i < sizeof(Dicerolls) / sizeof(int); ++i)
   {
       cout << "Roll " << i + 1 << ": ";
       cin >> Dicerolls[i];

       if (Dicerolls[i] < 1 || Dicerolls[i] > 6)
       {
           exit(1);
       }
       else
       {
           NumCount[Dicerolls[i] - 1]++;
           // check straights
           straight ^= (-1 ^ straight) & (1 << (Dicerolls[i] - 1));
       }
   }

   for (unsigned int i = 0; i < sizeof(NumCount) / sizeof(int); ++i)
   {
       cout << endl << "There are " << NumCount[i] << " " << DieNames[i];

      
       switch (NumCount[i])
       {
       case 2:
           TwoKind = true;
           break;
       case 3:
           ThreeKind = true;
           break;
       case 4:
           FourKind = true;
           break;
       case 5:
           FiveKind = true;
           break;
       }
   }

  
   int TotalRolles = firstRoll + secondRoll + thirdRoll + fourthRoll + fifthRoll;
   if (FourKind) cout << "four of a kind!" << endl;
   if (FiveKind) cout << "five of a kind!" << endl;
   if (TwoKind && ThreeKind) cout << "Full House" << endl;
   else
   {
       if (ThreeKind) cout << "three kind" << endl;
       else if (TwoKind) cout << "two kind" << endl;
   }

  
   if (straight == 35 || straight == 62)
   {
       cout << "long straight!" << endl;
   }
  
   if (straight == 25 || straight == 30 )
   {
       cout << "short straight" << endl;
   }
  
  
  
  
   return 0;

   system("pause");
}

Explanation / Answer

#include "stdafx.h" #include #include #include void diceRoll(); void dice1(); void dice2(); void dice3(); void dice4(); void dice5(); void dice6(); using namespace std; int getNum(); int main() { srand(static_cast(time(0))); diceRoll(); cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote