Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programmed in Java Creating Additional Classes for a Monopoly garne Section 4 of this chapter described the BoardSquare class, a class of objects for squares

Programmed in Java image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Creating Additional Classes for a Monopoly garne Section 4 of this chapter described the BoardSquare class, a class of objects for squares on a monopoly board. The NetBeans project Monopoly included with the files for this chapter, has that class and a public lass named Monopoly with an executable main method. Your task is to create a new dass of objects for a player in a monopoly game, and to revise the public method in the Monopoly Netleans project so that a player can move around the board. We are not implementing a complete monopoly game, but just creating a player class and testing how it works with the BoardSquare class in the Monopoly eans pe The class discussion for this week is about this project. You may work with other students and communicate about the project through the class discussion, through email, or by meeting in person, to discuss the design and programming for this project, but each person should do his or her own work, writing his or her own code. You must participate in the class discussion. Your lab report should indicate who you worked with. You should: Design and create the class declaration for the player class according to the annotated UML diagram below, and add the class it to the NetBeans Monopoly project. 1. 2. Modify the main) method in the Monopoly class so that the player moves around the board, as follows: the player's location will be the square that the player's token is currently on. the player's location should start on Square zero, the Go square. the computer should pick a random number beween 1 and 12 to simulate the roll of a pair of dice. it should pick two random numbers between 1 and 6 and add them together to ensure the same probability as rolling real dice. b. the player's location should stat on Square ero, the Go square. b. e main method should then move the player to the new square by adding the random to the number of the square the player is on, and set the player's location to the new square. The squares are numbered 0 to 39, so whenever the new square number would go above 39 it should be reset (If newsquare > 39, then newsquare- Creating Additional Classes for a Monopoly garne Section 4 of this chapter described the BoardSquare class, a class of objects for squares on a monopoly board. The NetBeans project Monopoly included with the files for this chapter, has that class and a public lass named Monopoly with an executable main method. Your task is to create a new dass of objects for a player in a monopoly game, and to revise the public method in the Monopoly Netleans project so that a player can move around the board. We are not implementing a complete monopoly game, but just creating a player class and testing how it works with the BoardSquare class in the Monopoly eans pe The class discussion for this week is about this project. You may work with other students and communicate about the project through the class discussion, through email, or by meeting in person, to discuss the design and programming for this project, but each person should do his or her own work, writing his or her own code. You must participate in the class discussion. Your lab report should indicate who you worked with. You should: Design and create the class declaration for the player class according to the annotated UML diagram below, and add the class it to the NetBeans Monopoly project. 1. 2. Modify the main) method in the Monopoly class so that the player moves around the board, as follows: the player's location will be the square that the player's token is currently on. the player's location should start on Square zero, the Go square. the computer should pick a random number beween 1 and 12 to simulate the roll of a pair of dice. it should pick two random numbers between 1 and 6 and add them together to ensure the same probability as rolling real dice. b. the player's location should stat on Square ero, the Go square. b. e main method should then move the player to the new square by adding the random to the number of the square the player is on, and set the player's location to the new square. The squares are numbered 0 to 39, so whenever the new square number would go above 39 it should be reset (If newsquare > 39, then newsquare

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

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions