COMMENT AND FORMAT EVERYTHING APPROPRIATELY OR LOSE MARKS!
1- Create a program that generates 10 values in the range from +500 to -2500 and store these in an array of type WORD. Using these values, the program will: a) print the 10 values in two rows of 5 as comma separated integers; b) report the overall average; c) average of the positive numbers; and d) average of the negative numbers.
The output should look something like this:
For this program, the following requirements must be adhered to:
a) Each of the features (generate random values, populate array, print array, calc and print averages) must have a separate function.
b) All values will be integers including the averages.
c) All procedures must preserve register values whenever possible.
d) Any procedure returning an answer must do so in the EAX register.
e) No procedure can directly reference the array. Only use indirect operands with the offset and
size of the array being passed as a parameter on the stack (named or unnamed).
f) Fully comment the code including header comments, comments at the start of each procedure,
and line codes neatly in a right column. (Penalty up to 50% for not doing this.)
g) Your procedures must only use of parameter passing using unnamed parameter values (refer
to these using only the EBP register).
The output should look something like this:
+435, -1232, +123, -1487, -2319,
-485, +69, +198, -894, -2198
The overall average is: -779
The average of the positive numbers is: +206 The average of the negative numbers is: -1435
Hi, I'd like to help with the task.
I'll follow all the requirements (formatting, comments, etc.)
My full profile on this site: 280+ completed projects, average customer rating 5.0/5 (click on my name).
$70 CAD in 1 day
5.0 (200 reviews)
7.0
7.0
4 freelancers are bidding on average $88 CAD for this job