Question: Program Project: 1 . Consider a text file named scores.txt that contains player scores for a game. A possible sample is shown where Ronaldo's best
Program Project: Consider a text file named scores.txt that contains player scores for a game. A possible sample is shown where Ronaldo's best score is Fluff's best score is ect. RonoldoFluffPeleKakaChristianoCreate a class object using separate h and cpp files containing a methids named gethighScire that takes a string reference parameter and an integer reference parameter. The method should scan through the file and set the reference parameter to the name of the player with the highest score and the corresponding score. One problem with dynamic arrays is that once the array is created using the mew operator, the size cannot be changed. For example, you might want to add or delete entries from the array similar to the behavior of a vector. This project askes you to create a class called DynamicStringArray that includes member functions that allow it to emulate the behavior of a vector of string. The class should have the following: A private member variable called dynamicArray that references a dynamic array of type string A number private member variable called size that holds the number if entries in the array A default constructor that sets the dynamic array to nullptr and sets the size to A method that returns the size A method named addEntry that takes a string as input. The method creates a new dynamic array one element larger that the dynamic Array, copy the old elements and add the new string and updating the size and points to the new dynamic Array A method named deleteEntry that takes a string as input. The method creates a new dynamic array one element smaller and copies the remaining elements returning a pointer to the new array A method named getEntry that takes an integer returning the string at that index. Return a nullptr if the index is out of bounds A copy constructor allowing for the instance to be based on an existing object's entries Overloaded assignment operator to perform a "deep copy" so the assigned object contains it's own copy and not point to the same location Destructors as appropriate.
Must be in C and also include the names and scores
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
