Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# In Assignment 05A, you made a craps game that played a designed number of games and calculated various statistics (# wins, # losses, %

C#

In Assignment 05A, you made a craps game that played a designed number of games and calculated various statistics (# wins, # losses, % wins, longest win streak, longest Lose streak count).

In this assignment, you need to modify your game to provide a "replay" feature:

  1. As you simulate game play, you need to "record" the activity. That is, you need to keep track of the game # being played, the initial roll values, subsequent roll values, game outcome (win/lose).
  2. After simulating all of the games and displaying the stats (same as in 05A), prompt the user in a loop to show the "replay" of a particular game. The user should be able to choose:
    1. The replay of a particular game by game number. For example, 23 means replay game number 23.
    2. The replay of the game with the number of rolls. :) (This means you will need to somehow track how many rolls of the dice are done for each game. Note that you could either count this and keep it as a field in the data associated with a game OR calculate it if the user specifies this option).
    3. An option to exit replay mode and quit the application
  3. Your instructions to the user (me) need to be CLEAR as to how to choose 2.1, 2.2, and 2.3.

Note that I am not telling you how you must implement this. However, one approach is to make a game class which would represent a single game's state data. You could have an array of these (remember, your 05A program prompts for the number of simulations, thus you know the array size). Each instance of the class needs to implement logic/data that allows an unlimited number of roll information to be saved (what chapter 8 data structure does this sound like) as well as oterh summary information (e.g. win/loss). For this version of the program, you may choose to implement this without the use of extra classes (i.e. in addition to your program class).

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

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions