Question: C++ ONLY PLEASE. videogame class Attributes title a pointer to a Text object, which will hold the title of the video game platform a pointer

C++ ONLY PLEASE.

videogame class

Attributes

  • title a pointer to a Text object, which will hold the title of the video game
  • platform a pointer to a Text object, which will hold the platforms that the video game is available on
  • year an integer representing the year the video game was released
  • genre a pointer to a Text object, which will hold the genre of the video game
  • ageRating a pointer to a Text object, which will hold the age rating of the video game
  • userRating a number between 0 and 100 representing the user rating from IGDB

Functions

Function name: VideoGame constructor

  • Parameters:
    • A pointer to a Text variable, containing the title of the video game
    • A pointer to a Text variable, containing the platform(s) of the video game
    • An integer containing the year the video game was released
    • A pointer to a Text variable, containing the genre of the video game
    • A pointer to a Text variable, containing the age rating of the video game
    • A number containing the IGDB (user) rating of the video game (out of 100)
  • Purpose: This function should be called when all video game information is known and it will create a new video game with this information.
  • Specifications: initialize all attributes to the arguments sent to this function.

Function name: ~VideoGame destructor

  • Purpose: This function is automatically called when a Video game object is destroyed. This function releases the dynamically allocated text arrays in the Video game.
  • Specifications: Release the dynamically allocated space for the video gameTitle, video gameGenre, and video gameRating.
  • Prints a message: VideoGame destructor: Released memory for title, platform, genre, & rating.

Function name: printVideoGameDetails

  • Parameters: none
  • Returns: none (void)
  • Purpose: This function should be called when the user wants to print ALL the video game information to the screen.
  • Specifications: Print the title, year, genre, rating & number of stars. Remember that in order to print the Text objects, you must call their displayText function.

Function name: printVideoGameDetailsToFile

  • Parameters: a file stream object (sent by reference)
  • Returns: none (void)
  • Purpose: This function should be called when the user wants to print ALL the video game information to the file.
  • Specifications: Print the title, year, genre, rating & number of stars to the filename that was sent to this function. In order to print the Text objects to the file, you must first retrieve the c-string attribute (calling the getText function) from this Text, and then you can print it to the file.

Function name: getVideoGameTitle (accessor function)

  • Parameters: none
  • Returns: a pointer to the Text object containing the video game title

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!