Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Many tabletop games use dice for various game mechanics. Dice come in many shapes and sizes, commonly having 4, 6, 8, 10, 12, or

Instructions

Many tabletop games use dice for various game mechanics. Dice come in many shapes and sizes, commonly having 4, 6, 8, 10, 12, or 20 sides. Many games require you to gather a set of dice of different sizes and roll them together. Create a program that simulates dice for a tabletop game.

a class representing a single die. The constructor should accept an integer indicating how many sides the die has. The class should have a function to simulate rolling the die, returning a random number within the valid range.

a class representing a pool of dice. This class should have functions to add or remove a die from the pool. The class should also have a function to roll all the dice in the pool and return the total that was rolled.

THERE'S A CODE GIVEN TO US THAT WE JUST NEED TO COMPLETE. I'LL UPLOAD A SAMPLE OUTPUT TOO THANKS!

image text in transcribedimage text in transcribedimage text in transcribed
TextEdit File Edit Format View Window Help G ( 1 1 8 4 Q Mon Aug 1 11:50 PM *[Solved] Please do this a X D2L Activity 5: Dice Pool - SC X _ Error 404 (Not found)!1 x (612) Set up a .NET Core X + Qv . to search.. C a coursehero.com/tutors-problems/Object-Oriented-Programming/38213996-Please-do-this-activity-in-C. .. . InputOutput (1).txt ow again Go to Preferences Download Xcode 13.3 now X Enter Command : ... adddice 6 Adding Dice 6. . . Properties Enter Command : Q adddice 4 Get home Adding Dice 4.. Q Enter Command : roll 4 Get connect Dice 4, Roll Result: 1 Group Share Add Tags Action Search Enter Command : Kind Date Added Receive ans roll 6 1 Result: {1}", dice. getSide(), Git Changes Dice 6, Roll Result: 4 Learn more Today at 11:3: Enter Command : 658 KB PDF Document adddice 16 786 bytes Plain Text Today at 11:0: Adding Dice 16. .. Enter Command 786 bytes Plain Text Today at 10:5 roll 16 Folder Today at 10:4 Many tableto Dice 16, Roll Result: 2 Enter Command : 196 KB ZIP archive Today at 10:4 and sizes, co roll 16 Dice 16, Roll Result: 6 gather a set ( Enter Command roll 16 simulates dic Dice 16, Roll Result: 7 Folder Jul 29, 2022 Create a clas Enter Command: rollall 15 KB ZIP archive Jul 29, 2022 indicating ho Rolling all Dice: Folder Jul 26, 2022 Dice 6: roll result: 2 rolling the die Dice 4: roll result: 2 Folder Jul 26, 2022 Dice 16: roll result: 5 Jul 26, 2022 Create a clas 401 KB ZIP archive remove a die from Tags Red pool and return th Previous 30 Days . Orange dotnet-sdk-2.1.818-osx-x64.pkg 180.8 MB Installe..ackage Jul 21, 2022 2 Caldor lul 21 2020 - Yellow THERE'S A CODE GIVEN TO US THAT WE JUST NEED TO COMPLETE. I'LL UPLOAD A ors Build Output Package Console Tool Output SAMPLE OUTPUT TOO THANKS! Drag and drop images or Upload OOP_Project.pdf Show All XDebug > Default DicePool Qv . to search.. Xcode 13.2.1 is currently selected in Preferences and is incompatible with the version of Xamarin.iOS being used. Don't show again Go to Preferences Download Xcode 13.3 now Solution x Program.cs DicePool No selection Properties DicePool A using System; Connected Services using System. Collections. Generic; 2 using System. Linq; > Dependencies using System. Text; {} Program.cs using System. Threading . Tasks; Git Changes namespace MyDicePool 10 11 public class Dice 12 13 // TODO create Dice classes 14 public class DicePool // TODO create DicePool classes class Program static void Main(string args) DicePool obj = new DicePool( ) ; string command; Console. WriteLine("Enter Command: ") ; command = Console. ReadLine ( ) ; command = command . Trim( ) ; command = command . ToLower ( ) ; string split = command. Split ( ) ; if (split [0] == "adddice") int sides = int. Parse(split [1] ) ; Console. WriteLine("Adding Dice {0}. ..", sides) ; obj . addDice (sides) ; else if (split [0] == "remove") int sides = int. Parse(split [1]) ; Console. WriteLine("Removing Dice {0}. ..", sides) ; obj . removeDice (sides) ; Ise if (split [0] == "roll") int sides = int. Parse(split [1] ) ; foreach (var dice in obj . dpool) A Packages restored with warnings & Errors Build Output Package Console Tool OutputDebug > Default DicePool Qv . to search.. Xcode 13.2.1 is currently selected in Preferences and is incompatible with the version of Xamarin.iOS being used. Don't show again Go to Preferences Download Xcode 13.3 now Solution * Program.cs DicePool No selection Properties DicePool A 50 O 51 Connected Services if (sides == dice. getSide() ) > Dependencies (2 Console. WriteLine("Dice {0}, Roll Result: {1}", dice. getSide(), dice. roll( ) ) ; {} Program.cs Git Changes else if (split [0] == "rollall") Console. WriteLine("Rolling all Dice:") ; obj . rollAllDice ( ) ; } while (command != "exit") ; A Packages restored with warnings & Errors Build Output Package Console Tool Output

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

Services Management The New Paradigm In Hospitality

Authors: Jay Kandampully

1st Edition

0131916548, 9780131916548

More Books

Students also viewed these General Management questions

Question

1. Information that is currently accessible (recognition).

Answered: 1 week ago