Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is what I got. below is my code. PLEASE FIX IT CORRECTLY. #include #include #include #include using namespace std; const int PLAYER1 = 0;

image text in transcribedimage text in transcribed

This is what I got.

below is my code.

PLEASE FIX IT CORRECTLY.

#include #include #include #include

using namespace std;

const int PLAYER1 = 0; const int PLAYER2 = 1; const int WINNING_SCORE = 100;

//FIXME (1): Implement the printIntro function void printIntro(){ cout > rollAgain; cout > rollAgain; cout

int main() { srand(4444);

// setup and initialize variables int turn = PLAYER1; int player1score = 0; int player2score = 0; string player1name; string player2name; printIntro();

// FIXME (2): get names of players cout > player1name; cout > player2name; cout

//play game while (player1score

//player 1's turn or player 2's turn if (turn == PLAYER1) { player1score = humanTurn(player1name, player1score); turn = PLAYER2; } else { player2score = humanTurn(player2name, player2score); turn = PLAYER1; } } // FIXME (7): Output who won the game if(player1score >= WINNING_SCORE){ cout

return 0; }

6: Compare output Charles Ada Y Y Y Y Y n Input y n y y y y y y y y y y y y y y y Charles You rolled a 6 Your score: 90 Do you want to roll again? (y) Charles You rolled a 3 Your score: 93 Do you want to roll again? (y) Charles Your output ends You rolled a 4 with Your score: 97. Do you want to roll again? (y) a J Charles You rolled a 2 Your score 99 Do you want to roll again? (y) J Charles

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

1. Explain why evaluation is important.

Answered: 1 week ago