9.7k views
1 vote
Write a complete program that: 1. Prompt the user to enter 10 numbers. 2. save those numbers in a 32-bit integer array. 3. Print the array with the same order it was entered. 3. Calculate the sum of the numbers and display it. 4. Calculate the mean of the array and display it. 5. Rotate the members in the array forward one position for 9 times. so the last rotation will display the array in reverse order. 6. Print the array after each rotation. check the sample run.

1 Answer

1 vote

Answer:

see explaination

Step-by-step explanation:

oid changeCase (char char_array[], int array_size ) {

__asm{

// BEGIN YOUR CODE HERE

mov eax, char_array; //eax is base image

mov edi, 0;

readArray:

cmp edi, array_size;

jge exit;

mov ebx, edi; //using ebx as offset

shl ebx, 2;

mov cl, [eax + ebx]; //using ecx to be the storage register

check:

//working on it

cmp cl, 0x41; //check if cl is <= than ASCII value 65 (A)

jl next_indx;

cmp cl, 0x7A; //check if cl is >= than ASCII value 122 (z)

jg next_indx;

cmp cl, 'a';

jl convert_down;

jge convert_up;

convert_down:

or cl, 0x20; //make it lowercase

jmp write;

convert_up:

and cl, 0x20; //make it uppercase

jmp write;

write:

mov byte ptr [eax + ebx], cl //slight funky town issue here,

next_indx:

inc edi;

exit:

cmp edi, array_size;

jl readArray;

mov char_array, eax;

// END YOUR CODE HERE

}

}

User UmeshR
by
4.7k points