[SOLVED] COSC6000-Homework 10

15.99 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

Rate this product

Develop a template class, ShiftArray that has following features.

template parameters are data type and size of array. Overload operator [] member function circshift(int n) that circularly shifts the elements in the array by n positions.

n is a int type.

If n is positive, shift elements towards right. If n is negative, shift elements towards left.

For example :

1 2 3 4 5     Initial array elements

 

5 1 2 3 4      circshift(1)

 

1 2 3 4 5      circshift(­1)

 

4 5 1 2 3      circshift(2)

Use code below to test your class:

https://tulane.instructure.com/courses/2165899/assignments/13470336                                                                                                    1/2

output will be:

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.