Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write And Test An Array Class [ StaticArray . h and StaticArray.TestDriver.cpp ] Write a data structures template. The resulting template can be used in
Write And Test An Array Class StaticArrayh and StaticArray.TestDriver.cpp
Write a data structures template. The resulting template can be used in any program in place of a C array.
Requirements. Develop StaticArray.h as you write StaticArray.TestDriver.cpp with class StaticArray, 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 values of unspecified type.
Let the capacity be set as part of the template specification, as modeled in the reading.
Include a square bracket getter and a setter, both with index rangechecking, returning whatever value you wish, if out of range.
Include a getter named StaticArray::capacity to return the data structure's capacity.
Initialize all data members to their default values in the constructor. That includes setting the array elements to their default data type.
Do all tests with int double and char Also do all 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!
Do NOT write any other functions in the public interface.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started