Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me with the java code also including the UML CLASS DIAGRAM AND OBJECT DIAGRAM. Thanks Project 4: High or Tie Game 1 Task

please help me with the java code also including the UML CLASS DIAGRAM AND OBJECT DIAGRAM. Thanks

image text in transcribedimage text in transcribed

Project 4: High or Tie Game 1 Task 1.1 Introduction Develop "High or Tie," a multi-player, computer-controlled game! On each turn, the player rolls a number between 1 and 100. The highest roll becomes the goal for other players to beat. Each player is allowed a specified number of strikes and are ejected from the game if they reach their strike limit. The current high player does not roll; they pass on rolling that round. If another player rolls the high roll, they become the new high player. The winner is the last player remaining in the game. 1.2 List The project requirements are a perfect place to use a circular linked list. Game continues player by player, so there is always a "next" player until the game is over. It is also a good place to use an iterator so that client code can easily do the required iteration. 2 Design Documentation Before you code, create appropriate design documentation and obtain feedback. Update designs per feedback, then use them during the rest of the development process and submit them as part of your project. This should include a UML Class Diagram and a UML Object Diagram. 3 Code Implementation 3.1 Classes You will create a small number of classes for this project: CircularLinkedList - a generic list class including methods like size, add (at the end?), get (by position), and remove (by value). O Start with class/instructor code and adapt it. o This class will have some private internal classes. o It should offer an iterator and support for/each loops. Let us be creative about what a "circular iterator means, as the whole point is to circle around the end and back to the front. O Do not expose client code to nodes; in fact, make it so this is not even possible. Plus, we want our list to maintain full control over its data; exposing nodes would let client code make a mess of things (e.g., critical next references), and that is not acceptable. Player - maintains a player name and the number of strikes against that player. Names will not change during the game; strikes are added during play, though. Game - contains the game logic. Its constructor should accept parameters for the number of players (named Player1" and similar, for now), the maximum number of allowed strikes, and the number of seconds to pause between moves. It should have a play method that plays the game that was already set up by the constructor. 3.2 Building Blocks You will use generics, circular linked list, iterators, and interface implementations. 4 Style and JavaDoc Follow the Course Style Guide. You will lose points on every assignment if you fail to do so. Write JavaDoc notation for the CircularLinkedList class (only). 5 Testing Test the CircularLinkedList class (only). Ensure that each method and state is fully tested, to the extent possible from outside the class. This must include constructors, accessors, mutators, and preconditions. If you are running an IDE that offers code coverage, tests should result in 100% coverage of the list class. 6 Submitting Your Work Follow the course's Submission Guide when submitting your project. 7 Hints Before coding this project, carefully consider design feedback and implement appropriate changes. There are plenty of subtleties required in manipulating linked lists; fall back to pencil and paper to ensure you know how to create and break links, and in what order to do them. Think carefully about return values from methods. If you can return information useful to client code, then do so, especially in cases where the code makes a request that you must gently refuse; a boolean return can let them know thanks, but I couldn't do that for you." 8 Extra Credit 8.1 Game Sounds Add sounds to the game. Play different sounds when a strike occurs, a player is eliminated, or a winner is announced. Clues: https://www3.ntu.edu.sg/home/ehchua/programming/java/J8c PlayingSound.html Another useful site contains a library of sounds; type in a keyword (be creative) and see what you can find: http://soundbible.com/ I used three.wav files in my version, all downloaded from this site. 8.2 Remove In the list class, in addition to remove by value, include an overload that removes by position. Also add a remove method to the iterator. These methods and helpers they call, if any) should not traverse more than necessary; you will need to think carefully about how to do this efficiently. Since you will be adding code to the list class, you will need tests for anything you add here. Project 4: High or Tie Game 1 Task 1.1 Introduction Develop "High or Tie," a multi-player, computer-controlled game! On each turn, the player rolls a number between 1 and 100. The highest roll becomes the goal for other players to beat. Each player is allowed a specified number of strikes and are ejected from the game if they reach their strike limit. The current high player does not roll; they pass on rolling that round. If another player rolls the high roll, they become the new high player. The winner is the last player remaining in the game. 1.2 List The project requirements are a perfect place to use a circular linked list. Game continues player by player, so there is always a "next" player until the game is over. It is also a good place to use an iterator so that client code can easily do the required iteration. 2 Design Documentation Before you code, create appropriate design documentation and obtain feedback. Update designs per feedback, then use them during the rest of the development process and submit them as part of your project. This should include a UML Class Diagram and a UML Object Diagram. 3 Code Implementation 3.1 Classes You will create a small number of classes for this project: CircularLinkedList - a generic list class including methods like size, add (at the end?), get (by position), and remove (by value). O Start with class/instructor code and adapt it. o This class will have some private internal classes. o It should offer an iterator and support for/each loops. Let us be creative about what a "circular iterator means, as the whole point is to circle around the end and back to the front. O Do not expose client code to nodes; in fact, make it so this is not even possible. Plus, we want our list to maintain full control over its data; exposing nodes would let client code make a mess of things (e.g., critical next references), and that is not acceptable. Player - maintains a player name and the number of strikes against that player. Names will not change during the game; strikes are added during play, though. Game - contains the game logic. Its constructor should accept parameters for the number of players (named Player1" and similar, for now), the maximum number of allowed strikes, and the number of seconds to pause between moves. It should have a play method that plays the game that was already set up by the constructor. 3.2 Building Blocks You will use generics, circular linked list, iterators, and interface implementations. 4 Style and JavaDoc Follow the Course Style Guide. You will lose points on every assignment if you fail to do so. Write JavaDoc notation for the CircularLinkedList class (only). 5 Testing Test the CircularLinkedList class (only). Ensure that each method and state is fully tested, to the extent possible from outside the class. This must include constructors, accessors, mutators, and preconditions. If you are running an IDE that offers code coverage, tests should result in 100% coverage of the list class. 6 Submitting Your Work Follow the course's Submission Guide when submitting your project. 7 Hints Before coding this project, carefully consider design feedback and implement appropriate changes. There are plenty of subtleties required in manipulating linked lists; fall back to pencil and paper to ensure you know how to create and break links, and in what order to do them. Think carefully about return values from methods. If you can return information useful to client code, then do so, especially in cases where the code makes a request that you must gently refuse; a boolean return can let them know thanks, but I couldn't do that for you." 8 Extra Credit 8.1 Game Sounds Add sounds to the game. Play different sounds when a strike occurs, a player is eliminated, or a winner is announced. Clues: https://www3.ntu.edu.sg/home/ehchua/programming/java/J8c PlayingSound.html Another useful site contains a library of sounds; type in a keyword (be creative) and see what you can find: http://soundbible.com/ I used three.wav files in my version, all downloaded from this site. 8.2 Remove In the list class, in addition to remove by value, include an overload that removes by position. Also add a remove method to the iterator. These methods and helpers they call, if any) should not traverse more than necessary; you will need to think carefully about how to do this efficiently. Since you will be adding code to the list class, you will need tests for anything you add here

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_2

Step: 3

blur-text-image_3

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

Is how things are said consistent with what is said?

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago