Question: In at&t assmebly: Write a program that will collect some integers into an array and then rotate those elements in the array according to the

In at&t assmebly: Write a program that will collect some integers into an array and then rotate those elements in the array according to the direction of the user. You will implement four procedures:
void getArray(int n, int *a) will read n elements from the console and put them into the
specified array.
void printArray(int n, int *a) will print the n elements of the array on a single line sepa-
rated by commas.
void rotateLeft(int n, int *a) will rotate the array to the left one slot. An element in slot
i will be copied to slot i 1. The element in slot 0 will find itself in slot n 1.
void rotateRight(int n, int *a) will rotate the array to the right one slot. An element in
slot i will be copied to slot i +1. The element in slot n 1 will find itself in slot 0.
After filling the array, print the contents out and prompt for a rotation (L or R) or exit (E). Allow for
case insensitivity. L and l should both trigger a left rotation. Repeat this process until the user selects
exit.
Dont try writing this program all at once. First, implement printArray with a fixed array. Next,
implement leftRotate and test it on that array, printing the array before and after the rotate. Do
the same with rightRotate. At this point, implement getArray. Once your functions are ready, go
ahead and get the prompt loop working. Adding case insensitivity of the prompt response will be the
final step.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!