Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write a program with 2 functions for a small straight category for Yahtzee. Please follow all directions and answer all parts. For this lab,

image text in transcribed

Please write a program with 2 functions for a small straight category for Yahtzee. Please follow all directions and answer all parts.

For this lab, we are going to collectively implement most of a Yahtzee game. Everyone will make a small piece of the game and we could then put all the pieces together to make a fully functioning game. The first step to make Yahtzee is to know how to play. Here are the official rules. With a partner, get a bag of dice and play a game. Use this online score sheet to keep score while you are playing. Be sure to take note of two pieces of information each round 1. What conditions must be satisified to earn points 2. How many points are scored for each category Play through a complete game. Who won? After you've played at least one complete game, take a look at the bag the dice came in. You should see a scoring category written on the outside. You will need to write two functions for this category 1. The first function will test the given five dice for whether the conditions of the Yahtzee category are met or not. We will represent each of our dice with an integer variable. Therefore, the function should accept as input five integers to represent our five dice. The function should return as output true if the conditions are met and false otherwise. Name the function isxvz where XYZ is the name of the category you are testing for in proper camel case 2. The second function returns the score if the current set of dice were going to be scored for that category. The function should accept as input five integers to represent our five dice. The function should return as output the score for the category. Name the function scorexYz where XYZ is the name of the category you are testing for in proper camel case. Recall for scoring some categories, a score should only be returned if the condition is present. If the dice do not satisfy the conditions, then zero is returned as the score For example, the two functions for the Full House category would be structured as follows: bool isFullHouse( int die1, int die2, int die3, int die4, int die5 // code goes here int scoreFullHouse( int diel, int die2, int die3, int die4, int die5) // code goes here

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

please try to give correct answer 1 1 3 .

Answered: 1 week ago

Question

Consistently develop management talent.

Answered: 1 week ago

Question

Create a refreshed and common vision and values across Europe.

Answered: 1 week ago

Question

Provide the best employee relations environment.

Answered: 1 week ago