Home / Expert Answers / Computer Science / gameinventory-cpp-and-source-cpp-please-submit-these-3-files-on-canvas-exis-pa314

(Solved): GameInventory.cpp and source.cpp. Please submit these 3 files on Canvas. exis ...



GameInventory.cpp and source.cpp. Please submit these 3 files on Canvas. exists and should not add this game to the vector.
Y- This method would compare two objects of Gamelnventory class and returns true if they are equal.
Hint: Objects are considerCurrent Games in the Inventory
Name: Need for Speed, Brand: XBox, Year: 2018, Price: 45
Name: Hitman 2, Brand: Playstation, Y???????

GameInventory.cpp and source.cpp. Please submit these 3 files on Canvas. exists and should not add this game to the vector. Your program should have a class with the following details: - private ? - public - A default constructor used to initialize data members to appropriate default values. GameInventory(string name, string brand, int year, double price); - A parameterized constructor used to initialize data members to their corresponding values from the parameters - A getter method that returns name - A getter method that returns brand - A getter method that returns year - A getter method that returns price - A display method that displays all the details about this class. Refer to the screenshot below. - This method would compare two objects of Gamelnventory class and returns true if they are equal. Hint: Objects are considered equal if values of data members of one object are equal to corresponding values of another object. Your program should have following 3 global methods in the header file of Gamelnventory: - This method would compare two objects of Gamelnventory class and returns true if they are equal. Hint: Objects are considered equal if values of data members of one object are equal to corresponding values of another object. Your program should have following 3 global methods in the header file of Gamelnventory: - boo1 searchInventory (vector\&GameInventory>\& v, GameInventory\& game) - Searches for a game in the vector of games. Please note that vector provided to this function is expected to contain collection of games. Use the ) method created in the class above to compare this game with each element of the vector which itself is a Gamelnventory object. Refer to main method for more information on this. - Displays all the elements (games) in the vector. Refer to the screenshot on how to display the information. - bool addnewGame(vector\& , GameInventory\& game); - Adds a specific game to the vector. This function should have a try catch block. If element is inserted to the vector successfully then return true from the try block else return false from the catch block. You can only use and libraries. You must use this main method to run your program. Current Games in the Inventory Name: Need for Speed, Brand: XBox, Year: 2018, Price: 45 Name: Hitman 2, Brand: Playstation, Year: 2020, Price: Name: Mario Brothers, Brand: Nintendo, Year: 2010, Price: 30 Name: Assassin's Creed, Brand: Playstation, Year: 2021, Price: Name: Uncharted 4: A Thief's End, Brand: Playstation, Year: 2020, Price: 85 Name: Spiderman Miles Morales, Brand: XBox, Year: 2021, Price: 65.5 Name: Resident Evil, Brand: XBox, Year: 2018, Price: 45 Adding another game in the Inventory... Following Game added to the inventory successfully... Name: Hitman 3, Brand: Playstation, Year: 2022, Price: 95 Current Games in the Inventory Name: Need for Speed, Brand: XBox, Year: 2018, Price: 45 Name: Hitman 2, Brand: Playstation, Year: 2020, Price: Name: Mario Brothers, Brand: Nintendo, Year: 2010, Price: 30 Name: Assassin's Creed, Brand: Playstation, Year: 2021, Price: Name: Uncharted 4: A Thief's End, Brand: Playstation, Year: 2020, Price: 85 Name: Spiderman Miles Morales, Brand: XBox, Year: 2021, Price: 65.5 Name: Resident Evil, Brand: XBox, Year: 2018, Price: 45 Name: Hitman 3, Brand: Playstation, Year: 2022, Price: 95 Adding another game in the Inventory... Following Game already exists in the Inventory ... Name: Need for Speed, Brand: XBox, Year: 2018, Price: 45 Current Games in the Inventory Name: Need for Speed, Brand: XBox, Year: 2018, Price: 45 Name: Hitman 2, Brand: Playstation, Year: 2020, Price: Name: Mario Brothers, Brand: Nintendo, Year: 2010, Price: 30 Name: Assassin's Creed, Brand: Playstation, Year: 2021, Price: Name: Uncharted 4: A Thief's End, Brand: Playstation, Year: 2020, Price: 85 Name: Spiderman Miles Morales, Brand: XBox, Year: 2021, Price: 65.5 Name: Resident Evil, Brand: XBox, Year: 2018, Price: 45 Name: Hitman 3, Brand: Playstation, Year: 2022, Price: 95


We have an Answer from Expert

View Expert Answer

Expert Answer


The code for GameInventory.h in C++ is given below:#ifndef GAMEINVENTORY_H#define GAMEINVENTORY_H#include #include class GameInventory {private: st
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe