Answered You can hire a professional tutor to get the answer.

QUESTION

Please make sure it is pep9 language not an assembly.I will attached 2 forms to this assignment which both are examples. The file " Q27 Swap Numbers Source.PDF" is exactly the same program without fun

Please make sure it is pep9 language not an assembly.

I will attached 2 forms to this assignment which both are examples. The file " Q27 Swap Numbers Source.PDF" is exactly the same program without function. This assignment asking to convert the C program into pep 9 which operate with 3 functions.

getList - putList- Rotate

the second PDF attached is an example of similar program without rotate function. I attached this as a reference to ease your job.

here is the C code that needs to be converted to PEP9

#include

void getList(int ls[], int *n) {

int j;

scanf("%d", n);

for (j = 0; j < *n; j++) {

scanf("%d", &ls[j]);

}

}

void putList(int ls[], int n) {

int j;

for (j = 0; j < n; j++) {

printf("%d ", ls[j]);

}

printf("\n");

}

void rotate(int ls[], int n) {

int j;

int temp;

temp = ls[0];

for (j = 0; j < n - 1; j++) {

ls[j] = ls[j + 1];

}

ls[n - 1] = temp;

}

int main() {

int list[16];

int numItems;

getList(list, &numItems);

putList(list, numItems);

rotate(list, numItems);

putList(list, numItems);

return 0;

}

Sample Input

8

11 22 33 44 55 66 77 88 99

Sample Output

11 22 33 44 55 66 77 88

22 33 44 55 11 66 77 99

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question