Description: Bo Bing, is a dice game which is played by two players, with each player...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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... 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...
Expert Answer:
Answer rating: 100% (QA)
Code include include function prototypes int menu int rolladice main function int main int option va... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Create a risk management plan. You have a budget of $100,000 and a timeline of six (6) months for the plan. Refer to Figure A-1, Risk Management Plan Template, from Appendix A of the Hillson and...
-
In this Assignment you will create a class that represents a Social Media profile (like a Facebook profile many of you have). The name of this class will be SocialMediaProfile . There are many things...
-
Craps is a dice game in which two fair dice are cast. If the roller shoots a 7 or 11 on the rst roll, he or she wins. If the roller shoots a 2, 3, or 12 on the rst roll, he or she loses. (a) Compute...
-
Net sales revenue, net income, and common stockholders' equity for Vallen Optical Corporation, a manufacturer of contact lenses, follow for a four-year period. Requirements 1. Compute trend...
-
In Problems 1-2, use differentials to approximate the given number (see Example 2). Compare with calculator values. 1. 402 2. 35.2
-
Evaluate the expression using the order of operations. 13/16 7/8 14/15
-
Identify the research scenario, including the general area of focus. Develop a hypothetical research scenario that would necessitate the use of the Mixed Method A-B-A Design. The research will be...
-
Classification of Acquisition Costs Selected accounts included in the property, plant, and equipment section of Lobo Corporations balance sheet at December 31, 2009, had the following balances. Land...
-
B. The figure below shows the market of physician visit. Current market price for each physician visit is $5. Price ($) 9 8 7 6 5 0 1 2 3 4 Number of Physician Visits (Q) 1) According to the figure,...
-
The new computer-controlled conveyor belt is an exciting project that moves and positions items on the conveyor belt within 1 millimeter. The project will produce a new system for future...
-
You are a network administrator at Woodgrove Bank. Before implementing Active Directory and Exchange Server 2007 within your organization, you wish to investigate how DNS and SMTP work to relay email...
-
What are the social consequences of environmental degradation, climate change, and resource scarcity, particularly for marginalized communities and vulnerable populations disproportionately affected...
-
Sarafina and Donald have been married for 8 years and have 4 children together. However, their marriage started experiencing some matrimonial problems which resulted in her filing for a divorce....
-
Tom Lewis, an individual taxpayer, was assessed $250 in the current year for the construction of street lights in his neighborhood. It is thought that the street lights will reduce crime in the...
-
3000 grams of water (at a temperature of 20 C) is mixed with 1000 grams of hot water(at a temperature of 80 C). Assuming no heat energy is exchanged with the environment, what is the final...
-
The conflict of the play revolves around the question of which should be more important--our dedication to tradition and family or our dedication to the law and authority. On one end, we have...
-
Explore the following terms Wages, depreciation, and bad debts? Also discus are all these include in balance sheet? Why and how?
-
XYZ Inc. a calendar year, accrual basis corporation, had the following items during 2021: Gross revenue from operations Cost of goods sold $420,000 ($180,000) $9,000 LT capital gain .LT capital...
-
An all-NFA M is a 5-tuple (Q,, , q 0 , F) that accepts x * if every possible state that M could be in after reading input x is a state from F. Note, in contrast, that an ordinary NFA accepts a...
-
A two-dimensional finite automaton (2DIM-DFA) is defined as follows. The input is an m n rectangle, for any m, n 2. The squares along the boundary of the rectangle contain the symbol # and the...
-
Use the result of Problem 6.21 to give a function f that is computable with an oracle for A TM , where for each n, f(n) is an incompressible string of length n. Problem 6.21 Show how to compute the...
-
If a competitive firm's cost increases due to an increase in the price of a factor of production or a tax, the firm's manager can quickly determine by how much to adjust output by calculating how the...
-
The Canadian metal chair manufacturing market has \(n=78\) firms. The estimated 8.1 elasticity of supply is \(\eta_{0}=3.1\), and the estimated elasticity of demand is \(=-1.1\). Assuming that the...
-
If the cost function for John's Shoe Repair is \(C(q)=100+10 q-q^{2}+\frac{1}{3} q^{3}\), and its marginal cost function is \(M C=10-2 q+q^{2}\), what is its profit-maximizing condition given that...
Study smarter with the SolutionInn App