Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

Explain how absolute advantage and comparative advantage differ.

Answered: 1 week ago

Question

6. Identify characteristics of whiteness.

Answered: 1 week ago

Question

9. Explain the relationship between identity and communication.

Answered: 1 week ago