Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description: Bo Bing, is a dice game which is played by two players, with each player in succession having a turn at throwing the

 

          

Description: Bo Bing, is a dice game which is played by two players, with each player in succession having a turn at throwing the dice. Each player's turn results in a score, and the scores for each player accumulate to some winning total. In this practical assignment, you will create a modified and simplified version of Bo Bing game. This will give you practice with all three control constructs (sequence, selection and repetition). We are including some design constraints in the "Programming Requirements" section, so you will also use functions. This will give you the experience of decomposing a problem into parts, and then implementing each part in one highly cohesive, loosely coupled function. Modular programming: Do not try to compile your entire program in one "big bang". Compile it piece by piece. Test each piece that you have compiled to make sure it works correctly before you add the next piece. Bo Bing Rules in this Assignment: At the beginning, each player rolls one dice, with the highest roll going first. On their turns, players put two dice into the dice cup and then roll them. They then they keep the score according to the table (see the scoring table below). This forms their running score for the round. After that, they roll again and add worth points to their running total. This process is repeated 3 times. In this programming assignment, your task is to write a simplified game for 2 players and 3 rounds. Your program should display the dice values for each round, accumulate and display the points won by each player and find the player that makes more points. Rule 1 2 3 Dice 1 Double is rolled (E.g.Dice1: 1 Dice2:1, Dice 1:5 Dice2:5.......) Neither shows 1 (E.g. Dice 1:5 Dice2:6,....) A single one is rolled (E.g. Dice 1:4 Dice2: 1,...) . Points 300 200 100 Programming Requirements: In order to implement this game you will need to write at least the following functions, but if you need more functions you can add them. menu - This function asks the user the following: (1) Start the game by selecting who will start first (2) Exit Page 1 of 3 roll_a_dice - This function will roll a dice and return the result. The rolling action should be done randomly. compute_points - This function will compute the points won by each player at the end of each roll. It will get the dice values, then compute the points and return it to main() Sample Run: BO BING GAME Choose one from the followings: 1. Start the game by selecting who will start first 2. Exit Option: 1 BO BING STARTS Dice are rolled by each player in order to select who will start first: Dice 1 (rolled by player 1): 6 Dice 2 (rolled by player 2): 4 Player 1 is starting! ROUND 1 PLAYER 1'S TURN Dice are rolled: Dice 1: 2 Dice 2: 3 Points: 200 Total Pointa: 200 Dice are rolled: Dice 1: 2 Dice 2: 3 Points: 200 Total Points: 400 Dice are rolled: Dice 1: 5 Dice 2: 3 Points: 200 Total Points: 600 PLAYER 1'8 TURN IS OVER! ROUND 1 POINTS: 600 PLAYER 2'S TURN Dice are rolled: Dice 1: 6 Points: 300 Total Points: 300 Dice 2: 6 Dice are rolled: Dice 1: 5 Points: 200 Total Pointa: 500 Dice 2: 4 Dice are rolled: Dice 1: 3 Dice 2: 1 Points: 100 Total Points: 600 PLAYER 2'S TURN IS OVER! ROUND 1 POINTS: 600 ROUND 3 FINAL RESULT: PLAYER 1: 1200 POINTS PLAYER 2: 800 POINTS PLAYER 1 IS WINNER! CONGRATULATIONS... Write a C program about this game. Description: Bo Bing, is a dice game which is played by two players, with each player in succession having a turn at throwing the dice. Each player's turn results in a score, and the scores for each player accumulate to some winning total. In this practical assignment, you will create a modified and simplified version of Bo Bing game. This will give you practice with all three control constructs (sequence, selection and repetition). We are including some design constraints in the "Programming Requirements" section, so you will also use functions. This will give you the experience of decomposing a problem into parts, and then implementing each part in one highly cohesive, loosely coupled function. Modular programming: Do not try to compile your entire program in one "big bang". Compile it piece by piece. Test each piece that you have compiled to make sure it works correctly before you add the next piece. Bo Bing Rules in this Assignment: At the beginning, each player rolls one dice, with the highest roll going first. On their turns, players put two dice into the dice cup and then roll them. They then they keep the score according to the table (see the scoring table below). This forms their running score for the round. After that, they roll again and add worth points to their running total. This process is repeated 3 times. In this programming assignment, your task is to write a simplified game for 2 players and 3 rounds. Your program should display the dice values for each round, accumulate and display the points won by each player and find the player that makes more points. Programming Requirements: In order to implement this game you will need to write at least the following functions, but if you need more functions you can add them. O *menu - This function asks the user the following: (1) Start the game by selecting who will start first (2) Exit *roll_a_dice - This function will roll a dice and return the result. The rolling action should be done randomly. *compute_points - This function will compute the points won by each player at the end of each roll. It will get the dice values, then compute the points and return it to main() Sample Run: BO BING GAME! Choose one from the followings: 1. Start the game by selecting who will start first 2. Exit Option: 1 BO BING STARTS Dice are rolled by each player in order to select who will start first: Dice 1 (rolled by player 1): 6 Dice 2 (rolled by player 2): 4 Player 1 is starting! ROUND 1 -PLAYER 1'S TURN Dice are rolled: Dice 1: 2 Dice 2: 3 Points: 200 Total Points: 200 Dice are rolled: Dice 1: 2 Dice 2: 3 Points: 200 Total Points: 400 Dice are rolled: Dice 1: 5 Dice 2:3 Points: 200 Total Points: 600 PLAYER 1'S TURN IS OVER! ROUND 1 POINTS: 600 PLAYER 2'S TURN Dice are rolled: Dice 1: 6 Dice 2: 6 Points: 300 Total Points: 300 Dice are rolled: Dice 1: 5 Dice 2: 4 Points: 200 Total Points: 500 Dice are rolled: Dice 1: 3 Dice 2: 1 Points: 100 Total Points: 600 PLAYER 2'S TURN IS OVER! ROUND 1 POINTS: 600 ROUND 2 ROUND 3 FINAL RESULT: PLAYER 1: 1200 POINTS PLAYER 2: 800 POINTS PLAYER 1 IS WINNER! CONGRATULATIONS...

Step by Step Solution

3.52 Rating (159 Votes )

There are 3 Steps involved in it

Step: 1

Code include include function prototypes int menu int rolladice main function int main int option va... 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

Introduction to the theory of computation

Authors: Michael Sipser

3rd edition

1133187790, 113318779X, 9781285401065 , 978-0470530658

More Books

Students also viewed these Programming questions

Question

(c) What alternatives do you have?

Answered: 1 week ago