
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
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 nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Similar questions
- Written in Python with docstring please if applicable Thank youarrow_forwardHelparrow_forwardIn C# Use a one-dimensional array to solve the following problem. Write a class called ScoreFinder. This class receives a single dimensional integer array representing passer ratings for NFL players as an argument for its constructor. The test class will provides this argument. The test class then calls upon a method from the ScoreFinder class to start the process of finding a specific rating, which will be provided by the user. The method will iterate through the array and find any matching values. For all the matches that are found, the method will note the index of the cell along with its value. At completion, the method will print a list of all the indices and the associated scores along with a count of all the matching values.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

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