dice_player.py: Defines the DicePlayer class, which represents the player (and their computer opponent). It takes care...
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/08/64d492c055fa1_1691652798583.jpg)
Transcribed Image Text:
dice_player.py: Defines the DicePlayer class, which represents the player (and their computer opponent). It takes care of "rolling" the dice, keeping track of score, and updating both player's and opponent's scores based upon the roll. only file you will have to write code for is dice_player.py, in three of its methods: - present_scores: Write code to assign to the variable current_leader the String representing whichever player is ahead -- or "Actually, it's a tie (when the two scores are the same) final_scores: Same as the previous, for the variable winner. • do_roll: This is a complex method that will need to accomplish a number of things: 1. Announce that the player is rolling. (Already taken care of.) 2. Roll and get the values of each die - first and second - along with their difference (and sum, if needed.) 3. Announce what the player has rolled: the value of each die (in order) and the sum of the two. 4. Based on the values: Make a decision about how to update each player's score, make the updates, and announce the nature of the updates. (See the sample output below.) dice_player.py: Defines the DicePlayer class, which represents the player (and their computer opponent). It takes care of "rolling" the dice, keeping track of score, and updating both player's and opponent's scores based upon the roll. only file you will have to write code for is dice_player.py, in three of its methods: - present_scores: Write code to assign to the variable current_leader the String representing whichever player is ahead -- or "Actually, it's a tie (when the two scores are the same) final_scores: Same as the previous, for the variable winner. • do_roll: This is a complex method that will need to accomplish a number of things: 1. Announce that the player is rolling. (Already taken care of.) 2. Roll and get the values of each die - first and second - along with their difference (and sum, if needed.) 3. Announce what the player has rolled: the value of each die (in order) and the sum of the two. 4. Based on the values: Make a decision about how to update each player's score, make the updates, and announce the nature of the updates. (See the sample output below.)
Expert Answer:
Answer rating: 100% (QA)
Rhe diceplayerpy file that implements the DicePlayer class with the requested methods python import ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
(a) Identify FOUR advantages of finance companies over commercial banks regarding to business loan operations. (4 marks) (b) Identify and explain TWO reasons for increase in underwriting risk of life...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
KYC's stock price can go up by 15 percent every year, or down by 10 percent. Both outcomes are equally likely. The risk free rate is 5 percent, and the current stock price of KYC is 100. (a) Price a...
-
Let be an arbitrary operation in Problems 5259. Describe the operation for each problem. 5038; 70 2= 9; 901 = 10; 8 0 2 = 10; -
-
A $25,000, 6.25% coupon bond has 21 1/2 years remaining until maturity. Calculate the bond premium if the required return in the bond market is 5.2% compounded semiannually.
-
Conduct a follow-up analysis for the test in Exercise 49. Exercise 49. A survey by the National Institutes of Health asked a random sample of young adults (aged 19 to 25 years), Where do you live...
-
Weight-loss surgery and longer life. An article in the Washington Post reported that, according to two large studies, obese people are significantly less likely to die prematurely if they undergo...
-
ABCD Company is a general partnership. It consists of Dianne, Greg, Knox, and Laura, whose capital contributions were as follows: Dianne = $5,000, Greg = $7,500, Knox = $10,000, and Laura = $5,000....
-
please explain in details Discuss why each of the following is not an acceptable audit sampling technique. a. Select only 10 large payments made during the year for substantive testing of cash at...
-
1. Create and upload a histogram of the salary data for the city of Bell, where each bar width is about 50,000 US dollars. (Data for the histogram is at the bottom). a.) Is the distribution of the...
-
Sound Systems expects sales of 24,000 radios in the current year as follows: Sound Systems has also received a special order from a new customer for 4, 000 radios at $17 each. Sound Systems estimates...
-
2. Getting ready for Logarithms and Calculus! a. Fill in the chart and graph the function (I advise practicing on your scientific calculator and desmos. X f(x) = Inx 0 0.5 1 e 10...
-
JoJo Co. had the following balances and information for October. Beg. finished goods inventory = $30 Beg. work in process inventory = $5 Beg. raw materials inventory = $15 End. finished goods...
-
Subway sales have been declining since 2014. In the US, Subway has closed a number of stores due to over-expansion, outdated operations, and uninspiring menus. In Canada, Subway took a different...
-
Harvey Auto Parts purchased a new crane on September 1 for $35,000, paying $10,000 cash and signing a 7%, 12-month note for the remaining balance, interest to be paid at maturity. The crane is...
-
e4(k+1) Find the sum of the series. k = 1 8
-
Problem 7-25 (Algorithmic) George Johnson recently inherited a large sum of money he wants to use a pomon of this money to set up a trust fund for his two children. The trust fund has two investment...
-
10m solution. If Ka(HA) = 10 then pOH of solution will be [Given : log4=0.6] (A) 6.7 (B) Greater than 6.7 & less than 7.0 (C) Greater 7.0 & less than 7.3 (D) Greater than 7.3
-
Which of the following statements is not true? a. It is possible for a widget to not be visible in the Content panel. b. The Hierarchy section displays a tree view representation of your layout. c....
-
Java is architecturally ____________. a. Neutral b. Oriented c. Specific d. Abstract
-
You cannot delete a path ____________. A. Under any circumstances B. If it represents a directory C. If it represents a directory that is not empty D. If it represents more than five levels
-
40. The City of Pfeiffer starts the year of 2008 with the General Fund and an enterprise fund. The General Fund has two activities: education and parks/recreation. For convenience, assume that the...
-
41. Use the information in problem 40 to prepare the 2008 fund-based financial statements for the gov ernmental funds and the proprietary funds. A statement of cash flows is not required. Assume that...
-
37. The County of Maxnell decides to create a sanitation department and offer its services to the pub lic for a fee. As a result, county officials plan to account for this activity within the...
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App