subject
Computers and Technology, 03.04.2020 15:23 56340

Question: One Problem With Dynamic Arrays Is That Once The Array Is Created Using The New 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 Asks You To Create A Class Called DynamicStringArray That Includes Member Functions That Allow It To Emulate The Behavior ...
This problem has been solved!
See the answer
One problem with dynamic arrays is that once the array is created using the new 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 asks you to create a class called dynamicStringArray that includes member functions that allow it to emulate the behavior of a of strings.
The class should have the following:
1. A private member variable called dynamicArray that references a dynamic array of type string.
2. A private member variable called size that holds the number of entries in the array.
3. A default constructor that sets the dynamic array to Null and sets size to 0.
4. A function that returns size.
5. A function named addEnrty that takes a string as input. The function should create a new dynamic array one element larger than dynamicArray, copy all elements from dynamicArray into the new array, add the new string onto the end of the new array, increment size, delete the old dynamicArray, and then set dynamicArray to the new array.
6. A function named deleteEnrty that takes a string as input. The function should search dynamicArray for the string. If not found, it returns false. If found, it creates a new dynamic array one element smaller than dynamicArray. It should copy all elements except the input string into the new array, delete dynamicArray, decrement size, and return true.
7. A function named getEntry that takes an integer as input and returns the string at that index in dynamicArray. It should return Null if the index is out of dynamicArray

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:30
1. technician a says horsepower information can be used by consumers to compare the power of different automobile engines. technician b says that manufacturers will often list the horsepower output of their engines in the online service information. who is right?
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
To check whether your writing is clear , you can
Answers: 2
question
Computers and Technology, 23.06.2019 15:10
What role did women fill during world war ii?
Answers: 1
You know the right answer?
Question: One Problem With Dynamic Arrays Is That Once The Array Is Created Using The New Operator T...
Questions
question
Arts, 23.10.2020 23:00
question
Mathematics, 23.10.2020 23:00
question
English, 23.10.2020 23:00
question
Business, 23.10.2020 23:00
question
Mathematics, 23.10.2020 23:00
question
Chemistry, 23.10.2020 23:00
question
Mathematics, 23.10.2020 23:00
Questions on the website: 13722363