Implement a class to play a modified version of a game

Assignment Help C/C++ Programming
Reference no: EM131741537

Question: Design and implement a class to play a modified version of a game called Pig. In this game 3 dice are used. You will write a modified version of the Dice class from Lab 5 so that the 3 dice are stored in an array, not as individual integers. The user will compete against the computer. The goal is to reach 100 points before the computer does. On each turn, the current player (user or computer) rolls the dice and accumulates points. If, on any turn, the player/computer rolls two 1s, all points accumulated for that round are forfeited and the turn is over. If the player/computer rolls three 1s in one turn, the player/computer loses all points accumulated thus far in the game and the turn is over. The player may choose to end his/her turn after any roll or choose to continue rolling (be a pig) and risk losing points. The computer's turn will end when the total points accumulated for the turn is 20 or more. The game ends when either the computer or the player reaches 100 points after the end of a round (ie. if the player reaches 100 points, the computer still the last turn). Your program should indicate the winner or that there was a tie.

Reference no: EM131741537

Questions Cloud

What are the characteristics of a performance-driven team : What differentiates someone that is intrinsically motivated from someone that is extrinsically motivated? Give an example of how you would go about motivating.
How many trees should harry stock at hardware store : Harry's Hardware does a brisk business during the year, but during Christmas, Harry's Hardware sells Christmas trees for a substantial profit.
Environmental issues in reverse logistics : Review the relationship between reverse logistics and the environment. The paper will that try to establish how this relationship can be of value
What is the company stated strategy : Describe the industry that KFC operate in, Identify KFC along with the mission, vision, values, and strategic plan. Be sure to answer the following questions.
Implement a class to play a modified version of a game : Design and implement a class to play a modified version of a game called Pig. In this game 3 dice are used. You will write a modified version of the Dice class.
Aspects of the interactive system : You may choose one of the below options for storyboard design and prototype design - Aspects of the interactive system - designs flow in sequence
Discuss the reasons why their products are returned : Choose a specific company and discuss the reasons why their products are returned and/or recalled.
What will be the net effect of the transactions : Chris had no other property transactions this year. What will be the net effect of these transactions on Chris' tax return, in terms of gains and/or losses?
Estimate mmm cost of equity using dcf approach : Once again we can use the CAPM to estimate MMM's cost of equity. From the internet, you can find a number of different sources for estimates of beta.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Find and print the largest number in the array

Write a C program that declares an (integer) array of size 10, prompts the user to enter 10 integers and stores them in the array. The program should then

  Create a file, shared.txt

When your program starts, it shall do the following:1. Create a file, SHARED.txt, in the current directory (cwd). 2. Write it's pid (Process ID) followed by a Carriage Return and Newline in the file.

  Write function displayscorethat write score underneath

Write a function displayScorethat writes a score underneath the target. Give it suitable parameters. You can use turtle.write() to display information on the turtle canvas.

  Create a 1-dimensional (1d) array

Write a program to create a 1-dimensional (1D) array that contains 15 characters and display to the screen a count of the occurrences of each of the vowels a, e, i, o, and u in the array.

  Write a loop to total and average the contents of the array

Given the following code, write a loop to total and average the contents of the array.

  Write a complete c program to do the following1 the main

write a complete c program to do the following1. the main program will read in a parameter value n read this in main.

  Pointer variables to demonstrate shallow and deep copy

Using C++, write a program that uses pointer variables to demonstrate shallow and deep copy. The program should give the user the choice to do the following:

  Pixels down the right of the window

The blue and red values of the pixels across the top of the window are all the same, where the blue is at its maximum value while red is at its minimum value. The green values of the pixels down the right of the window are all the same, where gree..

  Write a function that will take in an array of integers

Write a function that will take in an array of integers, sum up all the values in the array, and return the result to the calling function.

  How do firms maximize profits

How do firms maximize profits? How do firms minimize risk?

  Make an explicit statement of the invariant of the set class

Prepare a new container class called ser, which is similar to a bag, except that a set can contain only one copy of any given item, you'll need to change the interface a bit.

  Program to produce ten random permutations of numbers

In C++(must be able to compile in Visual Studio ): Write a program to produce ten random permutations of numbers 1 to 10.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd