Programming Homework Help

COSC 1437 Texas A&M University Average Test Grade Assembly Questions

 

Professor Mavis Merrywether is teaching a graduate-level seminar on tropical diseases. Professor Merrywether is a respected scholar in the field, but she never really grasped arithmetic. After giving the class a test, she would like to know what the average test grade was. The test grades were as follows:

52, 77, 51, 89, 98, 74 ,85, 92, 95, and 86

Write an assembly procedure to calculate the average grade and display it.

The average grade for test 1 is

Then, write an assembly procedure to find the highest test grade from that array of grades and display it. (Professor Merrywether can certainly determine this on her own, but you think a bit of extra work will make her like you better.)

The highest grade on test 1 is

Use the c code and write the 32-bit x86 assembly language in the _asm code block

#include <iostream>

using namespace std;

extern “C” long Average(long, long[]);

extern “C” long Highest(long, long[]);

void main()

{

long Average[10] = { 52, 77, 51, 89, 98, 74, 85, 92, 95, 86 };

long Highest[10] = { 52, 77, 51, 89, 98, 74, 85, 92, 95, 86 };

_asm {

}

cout << “The average grade for test 1 is ” << Average(10, Average) << endl;

cout << “The highest grade on test 1 is ” << Highest(10, Highest) << endl;

}