Question: Can someone please help me code this in c++? (not java or python). I am having a hard time.... Thank you! Exercise 2: N-sided Dice

Can someone please help me code this in c++? (not java or python). I am having a hard time.... Thank you!

Can someone please help me code this in c++? (not java or

Exercise 2: N-sided Dice Roller Create a dice rolling program. It should prompt the user to enter the number of sides (N) on the die they want to roll. The program should then generate a random number in the range 1 to N. After displaying the result, it should prompt the user, asking if they want to roll again. While the user answers "y", continue to roll again displaying the result, otherwise exit. HINT: Use, rand() as documented on and reviewed in zyBooks 2.19. Your program should return a *different* series of random numbers every time it is run. This requires "seeding" the random number generator with srand(). Example Output (underlined values are user inputs) Enter the number of sides on the die: 20 You rolled a 16. Do you want to roll again? (y) y You rolled a 5. Do you want to roll again? (y) y You rolled a 1 . Do you want to roll again? (y)n Enter the number of sides on the die: 2 You rolled a 1 . Do you want to roll again? (y)y You rolled a 2. Do you want to roll again? (y) y You rolled a 1 . Do you want to roll again? (y)n

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!