Question: 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

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 10400. Fluff's best score is 9800, ect.
Ronoldo
10400
Fluff
9800
Pele
12300
Kaka
8400
Christiano
8000
Create 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 0.
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.
Can someone write this in C++ please?
 Program Project: Consider a text file named scores.txt that contains player

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!