Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

read _ dice ( ) input five integers on one line separated by blank spaces. Convert to integersand return a list. To correct potential input

read_dice() input five integers on one line separated by blank spaces. Convert to integersand return a list. To correct potential input errors, values above 6 are recorded as 6 and valuesbelow 1 are recorded as 1. For example:>15126
>1-5196
score_dice(rounds) prompt the player to enter a series of dice values indicated byparameter rounds. Within a for loop, call read_dice()that returns a list. Check whichscoring category is achieved (if any) and add the appropriate score to a running total. Checkscoring categories from highest to lowest by calling each function such asfour_of_kind(). Only the first matching category is used and all other categories areskipped. Print the updated score at the end of each iteration. Warning, this is a long method!Sample of three rounds that includes two pair, five-of-kind and a large straight.
>35232
Score: 20
>44444
Score: 70
>52463
Score: 115
image text in transcribed

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions