Dice Multiplayer Game

Order Description

PART A In this simple turn-based multiplayer game, each player takes a turn rolling a pair of dice. After each roll their score is increased by the result (the score of 2 dice added together) and the next player will have their turn. - If a player’s roll includes a 2, increase the score by double the roll amount - If a player’s roll results in a total of 7, their score is decreased by 7 points - Note that scores do not go below 0 - If a player rolls a pair of 6s, their score is reset to 0 and the turn-taking order is reversed - If the player rolls a pair of 1s, they are eliminated from the game. This will continue until a winner is declared: either someone reaches 100 points or there is only one player left in the game. 1. Program the generic ​CircularDoublyLinkedList - Use the circularly and doubly linked list classes from our notes as a basis. - You must include a way for the CDLL to rotate in the reverse order - Suggestion: Start with the CLL and think of how it works with a DLL. You will not require sentinels. 2. Create a ​Player​ class that stores the player name and score information. Include any methods required to update the score. 3. Create a ​Game​ class that stores a ​CircularDoublyLinkedList​ of ​Player​ objects and simulates a game between 4 players. The output should include the result of each player’s turn, the final winner, and final scores of the remaining players. Also indicate those players, if any, who were eliminated. 4. Write a driver class called ​PartA​ that creates a list of four players of your choice and invokes a simulation of the game.Sample output: Harry rolled 2 and 1. Lucky 2, score is now 6 Ron rolled 2 and 5. Unlucky 7, score is now 0 Hermione rolled 5 and 4, score is now 9 Luna rolled 4 and 6, score is now 10 Harry rolled 4 and 2. Lucky 2, score is now 18 Ron rolled 3 and 2. Lucky 2, score is now 10 Hermione rolled 4 and 6, score is now 19 Luna rolled 1 and 3, score is now 14 Harry rolled 3 and 4. Unlucky 7, score is now 11 Ron rolled 2 and 5. Unlucky 7, score is now 3 Hermione rolled 3 and 2. Lucky 2, score is now 29 Luna rolled 2 and 1. Lucky 2, score is now 20 Harry rolled 1 and 3, score is now 15 Ron rolled 3 and 6, score is now 12 Hermione rolled 4 and 5, score is now 38 Luna rolled 4 and 4, score is now 28 Harry rolled 1 and 2. Lucky 2, score is now 21 Ron rolled 1 and 5, score is now 18 Hermione rolled 3 and 4. Unlucky 7, score is now 31 Luna rolled 6 and 6. Double 6, score is now 0. Reverse direction. Hermione rolled 4 and 6, score is now 41 Ron rolled 2 and 2. Lucky 2, score is now 26 Harry rolled 5 and 1, score is now 27 Luna rolled 1 and 1. Snake eyes! Player eliminated :( Hermione rolled 3 and 1, score is now 45 Ron rolled 5 and 4, score is now 35 Harry rolled 4 and 2. Lucky 2, score is now 39 Hermione rolled 3 and 3, score is now 51 Ron rolled 4 and 3. Unlucky 7, score is now 28 Harry rolled 2 and 3. Lucky 2, score is now 49 Hermione rolled 6 and 4, score is now 61 Ron rolled 6 and 6. Double 6, score is now 0. Reverse direction. Hermione rolled 3 and 4. Unlucky 7, score is now 54 Harry rolled 4 and 2. Lucky 2, score is now 61 Ron rolled 3 and 4. Unlucky 7, score is now 0 Hermione rolled 1 and 6. Unlucky 7, score is now 47 Harry rolled 2 and 5. Unlucky 7, score is now 54 Ron rolled 1 and 4, score is now 5Hermione rolled 5 and 4, score is now 56 Harry rolled 2 and 6. Lucky 2, score is now 70 Ron rolled 2 and 4. Lucky 2, score is now 17 Hermione rolled 4 and 5, score is now 65 Harry rolled 2 and 1. Lucky 2, score is now 76 Ron rolled 6 and 4, score is now 27 Hermione rolled 3 and 2. Lucky 2, score is now 75 Harry rolled 3 and 2. Lucky 2, score is now 86 Ron rolled 5 and 1, score is now 33 Hermione rolled 2 and 2. Lucky 2, score is now 83 Harry rolled 2 and 2. Lucky 2, score is now 94 Ron rolled 3 and 6, score is now 42 Hermione rolled 5 and 5, score is now 93 Harry rolled 3 and 6, score is now 103 Harry has won the game! :) Final scores are: Harry: 103, Ron: 42, Hermione: 93 (Eliminated: Luna) PART B Create a program that simulates the undo/redo features of an application. You will implement a simple calculator that asks the user for the basic arithmetic operation that they would like to perform on the ​last result​. Your program will: - Prompt the user to enter an initial number (first operand) - Then - prompt the user for the next operator and second operand - evaluate the expression - present the user with the result, which will be the new first operand - This will continue until the user chooses to quit, or undo (redo) an operation The undo operation will restore the last state. The redo operation restores the next state if an undo was previously performed.1. Create the generic ​ArrayStack​ that implements the ​Stack​ interface using an array. 2. Create a driver class called ​PartB ​and any other classes/methods that you may require. You must use two stack objects to hold items that will restore the states based on the function (undo ​"z"​ or redo ​"y"​) selected. Allow the user to quit (​"q"​) anytime. Sample output: Enter the first number: 10 Enter the next operation on 10: + 2 = 12 Enter the next operation on 12: - 3 = 9 Enter the next operation on 9: z UNDO: 12 Enter the next operation on 12: z UNDO: 10 Enter the next operation on 10: * 10 = 100 Enter the next operation on 100: / 5 = 20 Enter the next operation on 20: + 4 = 24 Enter the next operation on 24: z UNDO: 20 Enter the next operation on 20: z UNDO: 100 Enter the next operation on 100: yREDO: 20 Enter the next operation on 20: y REDO: 24 Enter the next operation on 24: y Nothing to redo. Enter the next operation on 24: + 6 = 30 Enter the next operation on 30: z UNDO: 24 Enter the next operation on 24: z UNDO: 20 Enter the next operation on 20: z UNDO: 100 Enter the next operation on 100: z UNDO: 10 Enter the next operation on 10: z Nothing to undo. Enter a number: 12 Enter the next operation on 12: q Goodbye!