Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program FirstToFive that simulates a head-to-head match where two players, Daniel and Johnny, each roll a pair of 6-sided dice. They will
Write a program FirstToFive that simulates a head-to-head match where two players, Daniel and Johnny, each roll a pair of 6-sided dice. They will continue to roll the dice until the first person wins 5 rounds. A round is won if the player has a higher combined roll than the other player, unless a pair of 1s is rolled. If a player rolls snake eyes (1+1), that player wins the round. If both players's combined roll is the same, the round ends in a tie. Your program must display the details of each round: each player's roll and the result of the round (the winner's name or tie). After the game is over, display the number of wins for each player and the final overall winner. Sample output: Daniel Johnny Round Winner 1 +5 4 +4 Johnny 2 +4 4 +3 Johnny 4+ 5 1 +6 Daniel 5 + 1 6 +3 Johnny 3 +2 1 +4 1+4 25 5+6 5 +1 Tie Johnny Daniel
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started