Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To design and implement a board game using inheritance and polymorphism. For this programming project, you and your partner will be writing a Java application

To design and implement a board game using inheritance and polymorphism.

For this programming project, you and your partner will be writing a Java application that implements the Monopoly Junior (2013 Standard North American Edition) board game using derived classes from an abstract class that represents a space on the game board.

Start of Play

  • Assume all 4 players are playing.
  1. Toy Boat
  2. Toy Car
  3. Little Hazel
  4. Little Scottie
  • Each player starts with $16 cash.
  • Computer will randomly choose which player will start, and then play continues in round robin.
  • On each turn

    • All players start at GO.
    • Player rolls the die and moves position that number of spaces clockwise from GO.
      • Always move forward, never backward.
      • Every time player passes or lands on the GO space collect $2!
      • Refer to the different spaces on the board to determine what happens if player lands on it.

    Game end

    • The game will end when a player goes bankrupt. A player will be bankrupt if:
      • hasnt got the cash to pay rent,
      • buy a property they land on, or
      • Pay a Chance card fee.

    The Board Spaces

    1. GO
    • Player collects $2 from the Bank every time player passes or lands on GO.
  • CHANCE
    • Randomly choose one of the 20 CHANCE cards
    • Advance to a light blue or red space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest light blue or red space and PAY rent to the owner.
    • Advance to an orange or green space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest orange or green space and PAY rent to the owner.
    • Advance to a pink or dark blue space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest pink or dark blue space and PAY rent to the owner.
    • Advance to a red space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest red space and PAY rent to the owner.
    • Advance to a light blue space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest light blue space and PAY rent to the owner.
    • Advance to an orange space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest orange space and PAY rent to the owner.
    • Advance to a brown or yellow or blue space. If one is unwonted, get it for FREE! If none is unwonted, advance to the closest brown or yellow or blue space and PAY rent to the owner.
    • Advance toBoardwalk.
    • Move forward5
    • Move forward 1 spaceortake another Chance card.
    • Advance toGO. Collect $2
    • Advance to theSkate Park. If no one owns it, get it for FREE! Otherwise, PAY rent to the owner.
    • Get out of jail free. Keep this card until you need it.
    • You did all your homework!Collect $2from the Bank.
    • Its your birthday!Collect $2from the Bank. Happy Birthday!
    • You ate too many sweets!Pay $2to the Bank.
    • Give this card to theToy Boat, and take another Chance Card.

    Toy Boat: on yournext turn, sail forward toanyunwonted property, and buy it. If all are owned, buy the closest property not owned by Toy Boat from the owner! Owner MUST sell.

    • Give this card to theToy Car, and take another Chance Card.

    Toy Car: on yournext turn, sail forward toanyunwonted property, and buy it. If all are owned, buy the closest property not owned by Toy Car from the owner! Owner MUST sell.

    • Give this card to theLittle Scottie, and take another Chance Card.

    Little Scottie: on yournext turn, sail forward toanyunwonted property, and buy it. If all are owned, buy the closest property not owned by Little Scottie from the owner! Owner MUST sell.

    • Give this card to theLittle Hazel, and take another Chance Card.

    Little Hazel: on yournext turn, sail forward toanyunwonted property, and buy it. If all are owned, buy the closest property not owned by Little Hazel from the owner! Owner MUST sell.

    1. GO TO JAIL
    • Go straight to jail! Do not pass GO. Do not collect $2 at the start of your next turn, pay $1 or use the Get out of Jail Free card if you have it. Then roll and move as normal. You can collect rent while In Jail.
    1. JUST VISITING
    • Do nothing.
    1. FREE PARKING
    • Do nothing.
    1. AN UNOWNED SPACE
    • If no one owns it, you must buy it!
    • Pay the Bank the amount specified for the space.
    • Change the state of the space to Owned with the corresponding Owner.
    1. AN OWNED SPACE
    • If another player owns it, pay the owner the specified rent amount.
    • If you own it, do nothing.
    • A PAIR = DOUBLE RENT!
    • If a player owns both properties of the same color, rent is double the specified rent amount.

    Properties

    1. Brown Spaces
    • Burger Joint $1
    • Pizza House $1
  • Brown Spaces
    • Ice Cream Parlor $2
    • Candy Store $2
  • Light Blue Spaces
    • Ice Cream Parlor $2
    • Candy Store $2
  • Pink Spaces
    • Library $2
    • Museum $2
  • Orange Spaces
    • Swimming Pool $3
    • Skate Park $3
  • Red Spaces
    • Video Arcade $3
    • Movie Theater $3
  • Yellow Spaces
    • Toy Store $3
    • Pet Store $3
  • Green Spaces
    • Bowling Alley $4
    • The Zoo $4
  • Dark Blue Spaces
    • Park Place $5
    • Boardwalk $5

    PROJECT REQUIREMENTS:

    You are required to write the following classes:

    1. Board Space: This should be an abstract class with one or more abstract methods. The class should at least have one abstract method called on Landing (). The definition of this method in the derived concrete classes should:
    • update the players cash balance,
    • update the players position on the board, and
    • If class is a property, update the state of the property (owned/unwonted, and owner).
  • Derived concrete classes of Board Space that represents different types of board spaces.
    • Chancecards class that represents the set of cards randomly chosen by a player, as needed.
    • Go
    • Jail
    • Just Visiting/Free Parking
    • Property
  • TheGame Boardclasses the represents the collection of all the concrete Board Space subclass instances defined in (2). The game board spaces may be statically or dynamically defined, as specified in the game.
  • APlayerclass that has instance variables that represents a players name, and cash amount.
  • AMonopolyJava application the implements the game play. The application should display a description of the activities during each turn. When the game ends, it should also identify who won and display the cash amounts left for each player.
  • 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

    Introduction to Wireless and Mobile Systems

    Authors: Dharma P. Agrawal, Qing An Zeng

    4th edition

    1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

    Students also viewed these Programming questions

    Question

    Solve the inequalities in Problems 4150. 7-5A Answered: 1 week ago

    Answered: 1 week ago