Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The purpose of this discussion is to get you thinking about how classes and clas

ID: 3916204 • Letter: T

Question

The purpose of this discussion is to get you thinking about how classes and class associations can be used in object-oriented design to model real-world things. Monopoly is a very popular board game that was originally developed in the early 1900s Players select pieces to represent themselves, and move around a game board by throwing a set of dice, buying or trading properties, developing their properties with houses and hotels, and collecting rent from their opponents. The basic rules of the game can be found here. Suppose you were tasked with designing a software version of the monopoly game. Identify classes and class associations that would be part of the design. Using a UML class diagram is fine, but do not write any code.

Explanation / Answer

Class: Board

Global Variables:

Functions:

1) public Board(int totalplayer): Accepts the total number of players.Generates a random number for the dice and identifies if the current square is Go, Jail, Vacation or Go to Jail.

2)public Square movePlayer(Player player, int face, boolean count)

3)public boolean hasWinner()

4)public Player getWinner()

5)public Player getMaxMoneyPlayer()

6)public int normalizePosition(int position)

7)public Player getCurrentPlayer()

8)public Player[] getPlayers()

9)public void nextTurn()

10)public Player getPlayer(int id)

11)public int getTotalSquare()

I'll also paste the JAVA code that I found on Github that creates a simple Monopoly game:

int currentTurn = 0; int totalPlayer = 0; Player[] players; Square[] squares = new Square[40]; String[] names = new String[] { "House", "Villa", "Town", "City", "Peace", "Village", "Jade", "Soi 4", "White", "Dark" };
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote