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.
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.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 9 images
Knowledge Booster
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.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education