Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write And Test An Array Class [ DynamicArray . h and DynamicArray.TestDriver.cpp ] Write and test a data structures template. The resulting template can be

Write And Test An Array Class [DynamicArray.h and DynamicArray.TestDriver.cpp]
Write and test a data structures template. The resulting template can be used in any program in place of a C++ array.
Requirements. Develop DynamicArray.h as you write DynamicArray.TestDriver.cpp with class DynamicArray, defined and fully tested. Write the public interface exactly as specified below -- do not add to, or change the public interface as specified.
Write the template for an array of capacity =2(default constructor) of unspecified type.
Include a public square bracket getter and setter pair, both with index range-checking, returning whatever value you wish if out of range. But apply capacity auto-adjusting for the setter if out of range high.
Include a public getter named DynamicArray::capacity() to return the data structure's now-variable capacity
Include a public setter named DynamicArray::capacity(int) to change the capacity.
Do tests with int , double , or char . Also do tests with an object, like string . Please complete all tests on one data type then move to another data type. DON'T mix each test with all data types!
Note that there is no good reason to copy the "dummy" value in the dynamic memory management functions, so don't include it in your testing of const object copy or object assignment.
DynamicArray template class public interface:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions

Question

Are robots going to displace all workers? Explain your answer.

Answered: 1 week ago