Create a project to play a bunch of games. Add a class that has main() in it. Create an abstract class called Game. Define one instance variable for the name of the game. Define a constructor that takes the name of the game as a parameter and sets it. Define an abstract method called playGame. It takes no arguments and returns void. Create a child class of Game called BoardGame. Rather than implementing playGame, declare BoardGame abstract. Create a child class of BoardGame called Chess or Battleship or Monopoly or whatever board game you want. Implement the playGame with only a message that says the name of the game and that it is being played. Create a child class of Game called CardGame. Rather than implementing playGame, declare CardGame abstract. Create a child class of CardGame for War. Implement the playGame method by with a message that says the game of war is being played. Create a child class of Game called VideoGame. Rather than implementing playGame, declare VideoGame abstract. Create a child class of VideoGame for a game of your choice. Implement the playGame method with only a message that says the name of the game and that it is playing. In the class with main() in it. Create all the different types of games. Store them in an array or ArraytList of type Game. Cycle through them to simulate playing all the games. Document all your classes.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
Create a project to play a bunch of games. Add a class that has main() in it. Create an abstract class called Game. Define one instance variable for the name of the game. Define a constructor that takes the name of the game as a parameter and sets it. Define an abstract method called playGame. It takes no arguments and returns void. Create a child class of Game called BoardGame. Rather than implementing playGame, declare BoardGame abstract. Create a child class of BoardGame called Chess or Battleship or Monopoly or whatever board game you want. Implement the playGame with only a message that says the name of the game and that it is being played. Create a child class of Game called CardGame. Rather than implementing playGame, declare CardGame abstract. Create a child class of CardGame for War. Implement the playGame method by with a message that says the game of war is being played. Create a child class of Game called VideoGame. Rather than implementing playGame, declare VideoGame abstract. Create a child class of VideoGame for a game of your choice. Implement the playGame method with only a message that says the name of the game and that it is playing. In the class with main() in it. Create all the different types of games. Store them in an array or ArraytList of type Game. Cycle through them to simulate playing all the games. Document all your classes.
Expert Solution
steps

Step by step

Solved in 4 steps with 9 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,