Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The goal of this assignment is to build a simulation of a popular children's dice game named Beat That. Beat That is an educational game

The goal of this assignment is to build a simulation of a popular children's dice game namedBeat That.Beat Thatis an educational game in which children learn strategic thinking and the concept of place value.

While the rules of the game can be flexible, we will be playing a basic version in which two players (Player A and Player B) are rolling two dice in a 5-round game. In each round, players take a turn in which they roll two dice. After rolling the dice, the player decides how to use the two dice values to form a 2-digit number. The goal is to arrange the digits so that they form the highest number possible. Your program will automatically make the choice for the playerchoosing the highest of the two possible combinations as the player's number choice for that round.

At the close of the round, your program will compare players' number choices for that round to determine the round scoring. The player with the highest number choice wins the round. There are 3 possible scoring outcomes of a round:

  • The Players Tie this Round
  • Player A Wins this Round
  • Player B Wins this Round

The program will print a message to announce the outcome of the round.

The player who wins a round scores 1 point in the overall game. The player who loses the round does not score a point in the overall game.If the players are tied for the round, then neither player scores a point in the overall game.

When five rounds have been played, the program will determine the outcome of the overall game based upon points earned. There are three possible outcomes of a game:

  • The Players Tie the Game
  • Player A Wins the Game
  • Player B Wins the Game

The program will print a message to announce the outcome of the game.

Instructions

Based upon the description above, how would you develop a program that implements the functionality for playing a 5-round game ofBeat That.

When this program is run, the console session should look like this:

Playing round 1 of Beat That... Player A rolls (2, 1) Player A chooses 21 Player B rolls (5, 2) Player B chooses 52 Player B Wins This Round! Playing round 2 of Beat That... Player A rolls (2, 2) Player A chooses 22 Player B rolls (1, 5) Player B chooses 51 Player B Wins This Round! Playing round 3 of Beat That... Player A rolls (4, 2) Player A chooses 42 Player B rolls (6, 1) Player B chooses 61 Player B Wins This Round! Playing round 4 of Beat That... Player A rolls (4, 6) Player A chooses 64 Player B rolls (4, 2) Player B chooses 42 Player A Wins This Round! Playing round 5 of Beat That... Player A rolls (2, 5) Player A chooses 52 Player B rolls (1, 5) Player B chooses 51 Player A Wins This Round! Game score: Player A has won 2 rounds. Player B has won 3 rounds. Player B Wins This Game! 

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions