Question: Please write it in C++ QUESTIONS [10 MARKS] Program 6 is a program to rotate right element of array that receives size of array and

Please write it in C++

Please write it in C++ QUESTIONS [10 MARKS] Program 6 is a

program to rotate right element of array that receives size of array

QUESTIONS [10 MARKS] Program 6 is a program to rotate right element of array that receives size of array and the integer as element in the array as input from the user. Complete a function called rotateRight in Program 6 that accepts two parameters, an integer array and the size of the array. The function will move one element to the right of array except for the final element of the array which will be moved to the first element. Figure 3 shows a sample of array, before and after rotation of one element is applied. Meanwhile, Figure 4 shows the example of program's input and output. (Hint: dynamic memory allocation is not required). Before: 8 4 0 7 2 [0] [1] [2] [3] [4] After rotate right of 1: 2 8 4 0 7 [0] [1] [2] [3] [41 Figure 3: Sample array of rotate right for one element moves. Size of array: 5 [Enter] A[0]: 8 [Enter] A[1]: 4 [Enter] A[2]: 0 [Enter] A[3]: 7 [Enter] A[4] : 2 [Enter] 1 Before rotation: 8 4 0 7 2 After rotation : 2 8 4 0 7 40123 11 1 2 3 4 Figure 4: Sample of run - example of program's input and output. // Program 6 #include #define N 12 using namespace std; void rotateRight (irt A[, int size) { 8 1/Complete your code here 9 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 int main() 25 { 26 int A[N], size; 27 28 cout > size; 30 31 for (int i 0; i > A[i]; 35 36 37 cout

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 Databases Questions!