Question: ONLY NEED 1 and 5 Objective for the Milestone: Write a program that will: Take in a Text Filename - The user should be asked
ONLY NEED 1 and 5
Objective for the Milestone: Write a program that will:
-
Take in a Text Filename - The user should be asked for the file name without the .txt extension at the beginning of the program.
-
Read in the Related .txt File - The text file will have one game on every line formatted as follows: title, genre, number of players, genre specific information, age recommendation, estimated time, parent specific information 1, parent specific information 2.
-
Create Objects out of each line in the file - This means creating nine object classes and creating an instance of the correct object class depending on the input read in. A list of the nine possible classes is as follows:
| Type | Examples | Required Field |
| Banking | Blackjack, Baccarat | Number of Cards, Bet |
| Trick | Euchre, Spades | Number of Cards, Number of Tricks |
| Patience | Klondike, Pyramid | Number of Cards, Remaining cards |
| Tile | Mahjong, Dominoes | Board Size, Number of Pieces, Number of tiles |
| Capture | Chess, Checkers | Board Size, Number of Pieces, Current board state |
| Strategy | Risk, Axis and Allies | Board Size, Number of Pieces, Pieces Remaining |
| FPS | Halo, Bioshock | Console, Installation Size, Number of angry 14 year olds |
| RPG | Final Fantasy, Skyrim | Console, Installation Size, Number of strange characters |
| Sport | FIFA, Madden | Console, Installation Size, Current team |
In addition to the type specific fields listed above each class must have the following attributes: number of players, title, genre, age recommendation, estimated time. Each class should also have a toString method (returning a String listing the related attributes that will assists in printing) and an isWin method (returning a boolean which represents whether or not the current player has won)
-
Store Objects in nine appropriately Typed ArrayLists - You should create a separate ArrayList for every object class, these nine ArrayLists represent your database.
Printing your Results - Once the file is read in and the nine ArrayLists are created and filled your program should output the number of games in each category and then ask the user for a genre name. Once a genre name is inputted, the driver should output a list of every game of that genre in the database
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
