Question: Programming Kniffel in C ++ Hello, can somebody help me with this task I would need a finished, running program to compare. Task: You should

Programming Kniffel in C ++

Hello, can somebody help me with this task

I would need a finished, running program to compare.

Task:

You should realize an object-oriented simulation of the dice game 'Kniffel' and with this simulation some statistical ones

Investigate questions. (Note: you don't need to know the game to do this. Everything you know

must, is in this assignment.) Use the class KniffelGame and the supporting class

FiveDice (see class diagrams):

The following applies to the data elements and element functions:

The FiveDice constructor ensures that every object is initialized by rollDice.

The member function rollDice implements the random throwing of five dice, whose numbers are in the array dice

and the sum of the numbers in points are stored.

sort sorts the array dice in ascending order using the sorting method 'Insertion-Sort'.

unique should remove values that occur multiple times in the previously sorted array dice. You are supposed to function

implement it yourself and use nonexistent unique implementations of the library. After expiry

of unique at the beginning of dice are the original values in ascending order, but each

Value only once. The last of these values is followed by a number of undefined values. The position of the first

these undefined values should be returned as size_t by unique. The smallest of unique

so the returned index value is 1 and the largest is 5 (if there are no multiple values).

difference takes two index values for the array dice and returns the difference between the associated values of

dice back.

toString gives the content of the array dice and the value of points in a suitable formatting as a string

back.

The KniffelGame constructor ensures that every object is initialized by rollAndProcess.

rollAndProcess generates new cube results, which are first sorted in fiveDiceSorted and then in five

DiceUnique can be saved as described under unique above; thereby the generated by unique

Return value adopted in firstIndexOut.

fullHouse returns the value true if and only if the elements of fiveDiceSorted double a number

and contain another number three times; otherwise the value false is returned.

smallStreet ('Kleine Strae') returns the value true if and only if the elements of fiveDiceSorted

contain four consecutive numbers; otherwise the value false is returned.

bigStreet ('Big Street') returns the value true if and only if the elements of fiveDiceSorted are five

contain consecutive numbers; otherwise the value false is returned.

kniffel returns the value true if and only if the elements of fiveDiceSorted have five identical numbers

contain; otherwise the value false is returned.

Programming Kniffel in C ++ Hello, can somebody help me with this

KniffelGame FiveDice - fiveDice Sorted: FiveDice fiveDiceUnique: FiveDice firstIndexOut: size_t + KniffelGame () + rollAndProcess(): void + fullHouse (): bool + smallStreet(): bool + bigStreet(): bool + kniffel (): bool dice: array - points: unsigned + FiveDice () + rollDice (): void + sort(): void + unique (): size_t + difference (size_t, size_t): unsigned + toString(): string + KniffelGame FiveDice - fiveDice Sorted: FiveDice fiveDiceUnique: FiveDice firstIndexOut: size_t + KniffelGame () + rollAndProcess(): void + fullHouse (): bool + smallStreet(): bool + bigStreet(): bool + kniffel (): bool dice: array - points: unsigned + FiveDice () + rollDice (): void + sort(): void + unique (): size_t + difference (size_t, size_t): unsigned + toString(): string +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!