Question
Video Game Inventory: -Video Game Class (20 pts) VideoGame.java -Video game Collection (30 pts) GameCollection.java -Video Game Driver (10 pts) VGDriver.java . You will need
Video Game Inventory:
-Video Game Class (20 pts) VideoGame.java
-Video game Collection (30 pts) GameCollection.java
-Video Game Driver (10 pts) VGDriver.java
.
You will need to perform the following steps:
.
Using the DVD class as a template:
1. Create a class called VideoGame that has the following private members:
-Game title (String)
-Game publisher (String)
-Year the game was released (int)
-Platform the game is played on (String)
-Price of the game (double)
-Completed status (boolean)
2. Modify the constructor so that it sets up a VideoGame object
3. Modify the toString so that it displays the contents of the VideoGame object
-Modify the if statement so that if the status is true, add the string Finished to the data.
.
Using the DVDCollection class as a template:
1. Create a class called GameCollection that has the following private members:
-An array of VideoGame objects
-Amount of games (int)
-total cost of games (double)
2. Modify the constructor so that it creates a VideoGame array of size 100
-Keep the initial values of count and totalValues from the template
3. Modify the addDVD method (call it addGame) so that it accepts the 6 corresponding parameters for a video game to set up a VideoGame object
4. Modify the toString method to Display information for the VideoGame collection
5. Modify the increaseSize method so that it doubles the size of the VideoGame array if needed
.
Using the Movie class is as template:
.1. Create a driver program called GameDriver, that tests your VideoGame Array object
2. Use the addGame method to add at least three games to the array
3. Check the contents of the array
4. Add at least one more game to the array using the addGame method
5. Check the updated contents of the array.
.
.
A sample of the output is shown below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ My Video Game Collection Number of Games: 3 Total cost: $60.97 Average cost: $20.32 Video Game List: $15.99 1997 Final Fantasy VII Square Enix PlayStation Finished! $19.99 2004 Ninja Gaiden Ubisoft Xbox $24.99 2005 Kingdom Hearts II Square Enix PlayStation 2 Finished! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ My Video Game Collection Number of Games: 4 Total cost: $82.92 Average cost: $20.73 Video Game List: $15.99 1997 Final Fantasy VII Square Enix PlayStation Finished! $19.99 2004 Ninja Gaiden Ubisoft Xbox $24.99 2005 Kingdom Hearts II Square Enix PlayStation 2 Finished! $21.95 2013 Tomb Raider Square Enix PlayStation 3
Tips:
- Keep in mind that the length of the string of your name can affect the formatting of the output (as it does in the sample), but its ok if this happens.
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