Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone help me fix me Jeopardy dice game this is what I have now #include #include using namespace std; int rollDie() { return (rand()

can someone help me fix me Jeopardy dice game

this is what I have now

#include #include using namespace std;

int rollDie() { return (rand() % 6+1); }

void askYoNs(){ cout<<"Do you want to roll a dice (Y/N)?:"<

void printScores(int turnTotal,int humanTotal,int compTotal){ int player; int human; if(player==human){ cout<<"Your turn total is "<=10 ///then switch player if(curr_player!=human && turnTotal >=10 ){ computerTotal+=turnTotal; curr_player=changePlayer(curr_player); turnTotal=0; printScores(turnTotal,humanTotal,computerTotal); } return curr_player; } void game(){ int player=human; int humanTotal=0; int computerTotal=0; int turnTotal=0;

if (turnTotal==0){ cout<<"Welcome to Jeopardy Dice!"<>YoN; roll=rollDie(); cout<<"You rolled a "<

///check who is winner if(humanTotal>=80){ cout<<"Congratulations! human won this round of Jeopardy Dice!"<

this is what I am trying to get it to return

Welcome to Jeopardy Dice!  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 2 Your turn total is 0 computer: 0 human: 0  It is now computer's turn  Computer rolled a 6 Computer turn total is 6 Computer rolled a 5 Computer turn total is 0 computer: 0 human: 0  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 5 Your turn total is 0 computer: 0 human: 0  It is now computer's turn  Computer rolled a 5 Computer turn total is 0 computer: 0 human: 0  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 5 Your turn total is 0 computer: 0 human: 0  It is now computer's turn  Computer rolled a 2 Computer turn total is 0 computer: 0 human: 0  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 3 Your turn total is 3 Do you want to roll again (Y/N)?: You rolled a 6 Your turn total is 9 Do you want to roll again (Y/N)?: computer: 0 human: 9  It is now computer's turn  Computer rolled a 5 Computer turn total is 0 computer: 0 human: 9  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 4 Your turn total is 15 computer: 0 human: 24  It is now computer's turn  Computer rolled a 2 Computer turn total is 0 computer: 0 human: 24  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 2 Your turn total is 0 computer: 0 human: 24  It is now computer's turn  Computer rolled a 2 Computer turn total is 0 computer: 0 human: 24  It is now human's turn  Do you want to roll a dice (Y/N)?: computer: 0 human: 24  It is now computer's turn  Computer rolled a 5 Computer turn total is 0 computer: 0 human: 24  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 3 Your turn total is 3 Do you want to roll again (Y/N)?: You rolled a 2 Your turn total is 0 computer: 0 human: 24  It is now computer's turn  Computer rolled a 1 Computer turn total is 1 Computer rolled a 3 Computer turn total is 4 Computer rolled a 4 Computer turn total is 15 computer: 15 human: 24  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 4 Your turn total is 15 computer: 15 human: 39  It is now computer's turn  Computer rolled a 1 Computer turn total is 1 Computer rolled a 1 Computer turn total is 2 Computer rolled a 5 Computer turn total is 0 computer: 15 human: 39  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 2 Your turn total is 0 computer: 15 human: 39  It is now computer's turn  Computer rolled a 5 Computer turn total is 0 computer: 15 human: 39  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 6 Your turn total is 6 Do you want to roll again (Y/N)?: computer: 15 human: 45  It is now computer's turn  Computer rolled a 5 Computer turn total is 0 computer: 15 human: 45  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 4 Your turn total is 15 computer: 15 human: 60  It is now computer's turn  Computer rolled a 6 Computer turn total is 6 Computer rolled a 2 Computer turn total is 0 computer: 15 human: 60  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 4 Your turn total is 15 computer: 15 human: 75  It is now computer's turn  Computer rolled a 5 Computer turn total is 0 computer: 15 human: 75  It is now human's turn  Do you want to roll a dice (Y/N)?: You rolled a 4 Your turn total is 15 computer: 15 human: 90  Congratulations! human won this round of Jeopardy Dice!

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

Prepare a constructive performance appraisal.

Answered: 1 week ago

Question

List the advantages of correct report formatting.

Answered: 1 week ago