Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

he code fragment below gives the algorithmic structure for correctly running the

ID: 3606824 • Letter: H

Question

he code fragment below gives the algorithmic structure for correctly running the display. Add code in the spaces indicated so that the complete display is fully updated every 30 milliseconds. Use delta timing long int column!nterval = long int nextColumnTime -columnInterval; long int currentTimemillis() void 1oop) // add code in spaces below (in addition to entry above) i// period for one column (in ms) selectColumn (column) to select col. lightLEDs (column) ; column = (column + 1) % 5; // next column Use space to the left // drive dig. outputs to complete answer // drive dig. outputs to light rows in col. Use space to the left to complete answer

Explanation / Answer

1)

int arraylength = 15
for (int i = 0; i < (arraylength / 2); i++) {
int tempArray= array[i];
array[i] = array[(arraylength - 1) - i];
array[(arraylength - 1) - i] = tempArray;
}
  
---------------------------------------------------
2)   
     
int main() {
char charArray[13];
   cin>>charArray;
int len = strlen(charArray);
sort(charArray, charArray+len);
do {
cout << charArray << endl;
} while (next_permutation(charArray, charArray+len));
   return 0;
}
--------------------------------------------
3)

void rotate(int arr[], int n)
{
int x = arr[n-1], i;
for (i = n-1; i > 0; i--)
arr[i] = arr[i-1];
arr[0] = x;
}

int main()
{
int arr[] = {1, 2, 3, 4, 5}, i;
int dist=2;

rotate(arr, dist);

cout<< "Rotated array ";
for (i = 0; i < d; i++)
cout<< arr[i];

return 0;
}