Question: (1) Write a declaration for a C++ structured-record type named VideoGame that includes as fields: a nonnegative integer named storage, an array of strings
(1) Write a declaration for a C++ structured-record type named VideoGame that includes as fields: a nonnegative integer named storage, an array of strings named game_name, and an array of nonnegative integers named data_size (representing the sizes of the corresponding games in bytes). Assume that the number of elements in both the data size and game name arrays is given by a constant named MAX SIZE (ii) Use the structured record from part (i) and the given prototype to write a function that loops through all values in the data_size array, in order, and prints a message if enough space remains in storage for corresponding game. For each iteration of the loop: If there is enough space in storage for the current game, subtract the data_size value from the storage and print a message saying: "game name fits in storage" (where game name is the current game). o If there is not enough space in storage, print: "game name does not fit in storage"
Step by Step Solution
3.31 Rating (154 Votes )
There are 3 Steps involved in it
i Declaration for a C structuredrecord type named VideoGame cpp const int MAXSIZE 10 Assu... View full answer
Get step-by-step solutions from verified subject matter experts
