Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create an abstract class named Game with the following attributes: game _ ID ( int ) , game _ Genre ( String ) , game
Create an abstract class named Game with the following attributes: gameID int gameGenre String gameSpecs ArrayList of type GameSpecs and gamePrice double where the gameID is a unique identifier that starts from the value yourstudentid and autoincrements with each creation of a new child object of the Game class.
Create the GameSpecs class with the following attributes: nameString numberOfPlayersint and datecreatedLocalDate Create the Setters and Getters for all attributes. In addition, implement an appropriate toString method for the GameSpecs class. Marks
Create the Setters and Getters for all of the Game attributes except the setter for the gameID In addition, create an abstract method name: getGameDescription that returns a String that describes the game in terms of its attributes. Marks
Create two child classes of the Game class. These are: PuzzleGame and ActionGame. Override the getGameDescription method in each of the child classes. Marks
In the main method of the Game class, create an ArrayList of Game objects and add two object to the list. The first object is an instance of the PuzzleGame, and the second object is an instance of the ActionGame. Marks
Draw a UML diagram that shows the classes, their attributes and methods, and the relationships that link them. Marks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started