Computer C++

 

Objective:

Become familiar with the use of Pointers in C++
Develop familiarity of using functions to process Pointers

Description:
Develop the object intArray that creates and manages an array of integers by the use of pointers. The intArray object will implement a number of useful manipulation of arrays including insert, delete, add, equal, and etc. These functions will limit the use of an array to proper handling. For example these functions will eliminate the possibility of overstepping the boundaries of an array.

Specific Requirements:

Your object should satisfy the following criteria:

Should be named intArray
Should contain a default constructor that will set the data pointer to null and size to 0.
Should contain an alternate constructor that will accept initial size and value for the array. If the initial value is missing, a default value of 0.
Should contain an alternate constructor that will accept an array and create an object equal to the array.
The parameter that holds the size of the array should be private.
Should contain a size method that will return the size of the array.
Should contain a set(index, value) method that will set the data[index] = value.
Should contain a get(index) method that will return data[index].
Both set and get methods should exit the program if index is outside of the array boundaries.
Should contain copy method that will copy one intArray into another.
Should contain equal method that will return true if two arrays are equal in size and content.
Should contain add and subtract methods that will add or subtract one intArry into/from another.

© 2020 customphdthesis.com. All Rights Reserved. | Disclaimer: for assistance purposes only. These custom papers should be used with proper reference.