One problem with dynamic arrays is that the created once array is using the might want to add or delete entries from the array. This project asks new operator the size cannot be changed. For example, you you to create a class called DynamicStringArray that includes member functions that allow it. The class should have the following private member variables dynamicArray that references a dynamic array of type string. size that holds the number of entries in the array. The class should have the following public methods: A default constructor that sets the dynamic array NULL and to sets size to 0. A function sizeIs that returns size. as input. The one element larger A function named addEntry that takes a string new dynamic array than dynamicArray, copy all elements from dynamicArray into the function should create a add the new string onto the end of the new new array, array, increment size, delete the old dynamicArray and then set dynamicArray to the new array. A function named deleteEntry that takes a string as input. The function should search dynamicArray for the string. If not found, new dynamic array one it returns false. If found, it creates a element smaller than dynamicArray. It should copy all elements except the input string into the new array, delete dynamicArray , decrement size, and return true. an integer in dynamicArray. return NULL if the index is out of dynamicArray's bounds. A function named getEntry that takes as input and returns the string at that index It should A destructor that frees up the memory allocated to the dynamic array. printDynamicArray () that displays the elements of the dynamicArray Instructions: You will be given 3 files: DynamicStringArray.h (Do not modify) DynamicStringArray.cpp (to be competed) main.cnn (Do not modify)
One problem with dynamic arrays is that the created once array is using the might want to add or delete entries from the array. This project asks new operator the size cannot be changed. For example, you you to create a class called DynamicStringArray that includes member functions that allow it. The class should have the following private member variables dynamicArray that references a dynamic array of type string. size that holds the number of entries in the array. The class should have the following public methods: A default constructor that sets the dynamic array NULL and to sets size to 0. A function sizeIs that returns size. as input. The one element larger A function named addEntry that takes a string new dynamic array than dynamicArray, copy all elements from dynamicArray into the function should create a add the new string onto the end of the new new array, array, increment size, delete the old dynamicArray and then set dynamicArray to the new array. A function named deleteEntry that takes a string as input. The function should search dynamicArray for the string. If not found, new dynamic array one it returns false. If found, it creates a element smaller than dynamicArray. It should copy all elements except the input string into the new array, delete dynamicArray , decrement size, and return true. an integer in dynamicArray. return NULL if the index is out of dynamicArray's bounds. A function named getEntry that takes as input and returns the string at that index It should A destructor that frees up the memory allocated to the dynamic array. printDynamicArray () that displays the elements of the dynamicArray Instructions: You will be given 3 files: DynamicStringArray.h (Do not modify) DynamicStringArray.cpp (to be competed) main.cnn (Do not modify)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question

Transcribed Image Text:One problem with dynamic arrays
is
that
the
is
created
once
array
using the new operator the size
might want
For example, you
to add or delete entries from the array. This project asks
cannot be changed.
you to create a
class called DynamicStringArray that includes member
functions that allow it.
The class should have the following private member variables
dynamicArray that references a dynamic array of type string.
size that holds the number of entries in the array.
The class should have the following public methods:
A default constructor that sets
the dynamic array
to
NULL
and
sets size to 0.
A function sizeIs that returns size.
function
named addEntry that
string
input.
element larger
А
takes
a
as
The
function should
create
new dynamic array one
a
than dynamicArray, copy all elements from dynamicArray into the
array,
add the
new string onto
the
end of
the
new
new
array,
increment
size,
delete
the
old dynamicArray
and
then
set
dynamicArray to the new array.
A function named deleteEntry that
takes
a string as input. The
function should search dynamicArray for the string. If not found,
it returns false.
If found, it creates
new dynamic array one
should copy all
delete dynamicArray ,
a
element smaller than dynamicArray.
It
elements
except the input string into the new array,
decrement size, and return true.
A
function
named getEntry that
takes
integer
input and
an
as
the
string at
index
in dynamicArray.
returns
that
It
should
return NULL if the index is out of dynamicArray's bounds.
A destructor that
frees up
the memory allocated to
the dynamic
array.
printDynamicArray ()
dynamicArray
that
displays
the
elements
of
the
Instructions:
You will be given 3 files:
DynamicStringArray.h
(Do not modify)
DynamicStringArray.cpp (to be competed)
main.cpp (Do not modify)

Transcribed Image Text:When the main.
срр
is
run, the program should present the
following input/output to the user:
->>> choose an option from the menu
1. Add an entry to the list of string..
2. Delete an entry to the list of string.
3.Display the list entries..
4. End Program....
<<<----
> Enter your option from the menu:1
>>> Enter a string to add to the list: live
>> Enter your option from the menu:1
>>> Enter a string to add to the list: nice
>> Enter your option from the menu:1
>>> Enter a string to add to the list: beautifull
> Enter your option from the menu:3
The list content:
live || nice || beautifull |
>> Enter your option from the menu:1
>> Enter a string to add to the list: enjoy
> Enter your option from the menu:3
The list content:
live || nice || beautifull || enjoy |
>> Enter your option from the menu:2
>> Enter a string to remove from the list: NICE
NICE is not in the list
> Enter your option from the menu:3
The list content:
| live || nice || beautifull || enjoy |
>> Enter your option from the menu:2
>>> Enter a string to remove from the list: nice
> Enter your option from the menu:3
The list content:
| live || beautifull || enjoy |
>> Enter your option from the menu:4
End of Program.Bye!
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY