Question: ( java ) Create a VideoGame class with the following attributes: Title ( String ) : The title of the video game. Genre ( String
javaCreate a VideoGame class with the following attributes:
Title String: The title of the video game.
Genre String: The genrecategory of the video game.
Platform String: The platform on which the video game can be played eg PC Xbox One, PS Nintendo Switch
Price double: The price of the video game in USD.
Create an ArrayList to store VideoGame objects.
Functionality in your maindriver:
Add Video Games:
Create a function named addGame that allows the user to add new video games to the inventory.
The function will prompt the user to enter the Title, Genre, Platform, and Price of the video game they want to add.
The entered information will be used to create a new VideoGame object, which will be added to the ArrayList.
Display Entire Inventory:
Create a function named displayInventory that will display the entire inventory of video games.
The function will iterate through the ArrayList of VideoGame objects and print the details of each game, including its Title, Genre, Platform, and Price.
The displayed data should be formatted in a clear and presentable manner, making use of formatting functions to enhance readability.
Search by Title:
Create a function named searchByTitle that allows the user to search for video games by their title.
The function will prompt the user to enter the title they want to search for.
The program will then search the ArrayList of VideoGame objects for all games with a matching title and display the details of each matching game.
Search by Platform:
Create a function named searchByPlatform that allows the user to search for video games by their platform.
The function will prompt the user to enter the platform they want to search for.
The program will then search the ArrayList of VideoGame objects for all games playable on the specified platform and display the details of each matc
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
