Answered step by step
Verified Expert Solution
Link Copied!

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: game_ID (int), game_Genre (String), game_Specs (ArrayList of type Game_Specs) and game_Price (double), where the game_ID is a unique identifier that starts from the value (your_student_id) and autoincrements with each creation of a new child object of the Game class.
Create the Game_Specs class with the following attributes: name(String), numberOfPlayers(int), and date_created(LocalDate). Create the Setters and Getters for all attributes. In addition, implement an appropriate toString() method for the Game_Specs class. (5 Marks)
Create the Setters and Getters for all of the Game attributes except the setter for the game_ID. In addition, create an abstract method name: getGameDescription() that returns a String that describes the game in terms of its attributes. (5 Marks)
Create two child classes of the Game class. These are: Puzzle_Game and Action_Game. Override the getGameDescription() method in each of the child classes. (4 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 Puzzle_Game, and the second object is an instance of the Action_Game. (3 Marks)
Draw a UML diagram that shows the classes, their attributes and methods, and the relationships that link them.

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

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago