Project #97655 - C++ HW

Project Six

 

Objective:

  1. Become familiar with the use of Pointers in C++

  2. 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:

  1. Should be named intArray
  2. Should contain a default constructor that will set the data pointer to null and size to 0.
  3. Should contain the alternate constructor intArray(int arraySize, int initValue) that will accept initial size and value for the array. If the initial value is missing, a default value of 0.
  4. Should contain the alternate constructor intArray(int anArray[], int arraySize) that will accept an array and create an object equal to the array. 
  5. Should contain a copy constructor.
  6. The parameter that holds the size of the array should be private.
  7. Should contain a size() method that will return the size of the array. 
  8. Should contain a set(index, value) method that will set the data[index] = value.
  9. Should contain a get(index) method that will return data[index].
  10. Both set and get methods should exit the program if index is outside of the array boundaries. 
  11. Should contain an overloaded assignment operator (=) similar to your previous copy(intArray anIntArray) method that will copy one anIntArray into another. Furthermore the operator= should be capable of cascaded operation. 
  12. Should contain an overloaded equality operator (==) similar to the equal(intArray anIntArray) method that will return true if two arrays are equal in size and content. 
  13. Should contain an overloaded addition and subtraction operator (+, -) similar to your previous add(intArray anIntArray) and subtract(intArray anIntArray) methods that will add or subtract one intArry into/from another. Both operations should be capable of cascaded operation. 
  14. Should contain overloaded post and pre-increment operators. Should be capable of cascaded operation. 
  15. Should contain overloaded unary - operator. Should be capable of cascaded operation.
  16. Should contain overloaded I/O-insertion ( << ) and I/O-extraction ( >> ) operators. Examples: cout << intArray should result in printing of the array to the stdout. cin >> intArray should prompt the user to entry values for every element of the array. Both operations need to be cascade enabled. 
  17. The copyadd and subtract methods above should exit the program if size incompatibility is identified.
  18. Should contain an insert(index, value) method that will insert the value at the index place of an array. The value should be inserted and not replaced. 
  19. Should contain a remove(index) method that will delete the index item of the array. Your method should then return the remove value. 
  20. Both insert and remove should exit the program if the index is invalid, and should expand/shrink the array appropriately. 
  21. Your program should have no memory leaks!
  22. Should also contain the following overloaded operators: +=, -=, [] on both left and right sides of the assignment operator.
  23. Your object should be template based to allow for user defined array types. 

Subject Computer
Due By (Pacific Time) 12/06/2015 08:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy