Computers and Technology
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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:00, brockmorrison3468
Is it ok to use a does red wine clean the inside of a computer true or false
Answers: 2
image
Computers and Technology, 22.06.2019 19:00, alyssashae1818
Which parts of a presentation should be the most general? a. introduction and conclusion b. introduction and outline c. outline and conclusion d. outline and body
Answers: 1
image
Computers and Technology, 23.06.2019 08:30, sofigaviria05
All of these are true about using adhesive except: a. dissimilar materials can be joined. b. mixing tips are product and material specific. c. a specific application gun may be required. d. two-part adhesives are dispensed using two mixing tips
Answers: 3
image
Computers and Technology, 23.06.2019 11:30, leapfroggiez
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
Answers: 1
Do you know the correct answer?
Question: One Problem With Dynamic Arrays Is That Once The Array Is Created Using The New Operator T...

Questions in other subjects:

Konu
Chemistry, 25.07.2019 12:30
Konu
Biology, 25.07.2019 12:30